http://www.perlmonks.org?node_id=452498


in reply to Porting a system 5 streams app to linux

I'm a bit confused by what you are asking here....

So you have a C app which forks and the forked process runs an arpitrary system/backtick app? Does the logging happen in the forked process or the parent process? (I assume the forked process here).

The last thing is, being unfamiliar with sysV streams, what sort of information is it passing back that you need to get?... Just the process name it wants to run or something more? Wouldn't the parent have to know that before forking?

I may have misunderstood much of what you have said and if so I will revise this post as needed.


dEvNuL
  • Comment on Re: Porting a system 5 streams app to linux

Replies are listed 'Best First'.
Re^2: Porting a system 5 streams app to linux
by suaveant (Parson) on Apr 29, 2005 at 03:51 UTC
    The C app is a basically simple logging daemon, which listens on a pipe.

    The major application is a job management system (Perl), which monitors for events and maintains resource and dependency information. When the everything is in place for a job (file came in to process, another job finished, whatever) then a new job is spawned which runs commands to process the job.

    The main monitor logs to this pipe, and when children are forked off they send some initialization data down the pipe to identify themselves and also redirect their stderr stdout to this pipe for logging.

    Where sysV streams come in, apparently even though both the parent and children are writing to the same copy of the pipe connection that they got through the fork, somehow the C app is able to figure out which process each incoming line is coming from.

                    - Ant
                    - Some of my best work - (1 2 3)