Tell me more ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am fairly new to *nix, and have come across the need to drop multiple processes, that should be run 100% of the time. to background using &.

I use the following line in an init.d script to do this (running as the user user:

su -c 'process arg1 arg2 -w - | process2 arg1 -r - &' user

(where -w writes to and -r reads from STDOUT, STDIN)

Specifically, I know this is not generally acceptable, as the processes aren't well shielded from outside influence.

Is it acceptable to create background jobs for "services?"

Should I instead use a FIFO/named pipe to handle the interprocess communication?

If so, should I still create both processes as background jobs? Is this stable?

For specifics, please refer to this mailing list thread.

Thanks,

Matt

share|improve this question
1  
Just a quick hint, have a look at the various process supervision tools, e.g. daemontools, runit, upstart, systemd -- they all require non-self-daemonizing services. – sr_ Jul 12 '12 at 19:41
Thanks, I will look into that itself. With the above "solution," I relied on the processes own ability to create PID files, then referred to them if -fwith killproc. – mbrownnyc Jul 12 '12 at 19:45

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.