I'm trying to set up an ordinary program, that writes stdout and
stderr, as a daemon, to be run as a SysV service (in
/etc/rc.d/init.d/).

My understanding is that I must somehow detach it from stdout and
stdin.  I think I also need to somehow return a value from starting it
up.

So I had thought instead of just running <program>, I'd write a script
that would wrap around program.  Then it would be that script which
would, in turn, be controlled by /etc/rc.d/init.d/<service>.

Can anyone point me in the right direction for how to do this?
Ideally, of course, a code snippet would be the best...

I think the script should fork a process to run <program>, redirect
its output (perhaps to a logfile) and error output (perhaps using
syslog), and then terminate.  Is that the right thing to do?

Thanks,
R


_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
Help beta test TCLUG's potential new home: http://plone.mn-linux.org
Got pictures for TCLUG? Beta test http://plone.mn-linux.org/gallery
tclug-list at mn-linux.org
https://mailman.real-time.com/mailman/listinfo/tclug-list