syslogd & return code

Rob Landley rob at landley.net
Tue Jan 10 01:30:58 UTC 2006


On Monday 09 January 2006 11:49, Roberto A. Foglietta wrote:
> > I'm just suprised that something
> > out there cares about the error return code of a daemon.  (Don't most of
> > them fork twice to disassociate themselves from the calling process?  An
> > init that tries to overcome that and check on an exit code that the
> > process goes out of its way to indicate is uninteresting is pretty much
> > broken.)
> >
> > But yeah, our code is wrong in an entirely abstract academic way, and
> > I'll fix it...
>
>   A script like that could check if daemon is immediately died or at
> least it is started. Not such silly as it could be thought at the first
> glance.
>   ;-)
>
>   Sometime a daemon will die just because lock-file or another daemon
> instance exists...

Which means it should be tracking the PIDs of what it spawned, not spawn 
another instance of something the first PID hasn't exited for, or notice that 
the elapsed time between a spawn and a restart is kinda short.  Most existing 
init programs will notice if they respawn something too fast.

Caring about the exit code of a process that wasn't your child in the first 
place (and if it forks twice, it wasn't) is _dumb_.

> even run daemon --status should be more appropiate 
> when --status option exists.

Now it's caring too much about the implementation of the daemons.

I still think it's a broken init program.

>   Cheers,

Rob
-- 
Steve Ballmer: Innovation!  Inigo Montoya: You keep using that word.
I do not think it means what you think it means.



More information about the busybox mailing list