suaveant has asked for the wisdom of the Perl Monks concerning the following question:
The system used a pipe and SysV streams to have one point of entry but keep track of which process sent the message in (my knowledge of this is minimal, please forgive me if I am not explaining it exactly right).
Our people have been having issues getting sysV streams to work on Linux, and really we figure there is probably a better solution.
What happens is this... the C daemon is started with some information about the application it is logging (a process manager). When jobs are started, they fork off and maintain the pipe, sending ininitialization info about who they are, which the logger stores. Somehow sysV streams can distinguish between which process is sending over the pipe, even though it is all just forked versions of the same copy. From that point on, anything from that subprocess' STDOUT and STDERR (and programs run in backticks, etc) is redirected to the logger and in mtimestamp is prefixed with a timestamp and the identifier the initializer set.
I am exploring ways of implementing this all in perl without sysV streams so that we can port it to Linux easier and to bring the codebase into line with the rest of the project.
So far I verified that UDP sockets would work alright, and of course TCP could be used... new sockets just have to be created at initialization, no big deal.
One thing I had tried was UDP over UNIX sockets, but I couldn't figure out a way to distinguish senders. The peerpath blows up IO::Socket::UNIX in this case...
Does anyone know if sender can be distinguished somehow in UDP UNIX domain sockets?
Does anyone have any other suggestions? Keep in mind that programs run in backticks and system calls also have to be redirected with on the same pipe.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Porting a system 5 streams app to linux
by devnul (Monk) on Apr 29, 2005 at 00:10 UTC | |
by suaveant (Parson) on Apr 29, 2005 at 03:51 UTC | |
|
Re: Porting a system 5 streams app to linux
by rg0now (Chaplain) on Apr 29, 2005 at 19:29 UTC | |
by suaveant (Parson) on Apr 29, 2005 at 20:30 UTC |