|Syntactic Confectionery Delight|
Re: Executing script in normal/daemon mode and adding start/stop capabilityby afoken (Monsignor)
|on Oct 07, 2009 at 22:23 UTC||Need Help??|
I prefer daemontools for background processes, as explained in Re: keep a module in shared memory. No need to add a single line of code to your script, no race conditions when handling PID files (because daemontools do not need PID files), and a simple control mechanism. Just write a char to a pipe or let the svc utility do that for you.
(And yes, djb's behaviour regarding errno is just silly and childish. Apply the patch from thedjbway.org or complain loudly to djb that he does not want to accept the C standards. And by the way, also apply the other patch that adds support for SIGQUIT, SIGUSR1, and SIGUSR2.)
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)