[PATCH] Write pid files for klogd, ntpd and watchdog

Tito farmatito at tiscali.it
Thu Dec 6 07:31:24 UTC 2012


On Wednesday 05 December 2012 21:20:16 Laurent Bercot wrote:
> > Several applets can be run as daemons, such as syslogd.  These
> > write pid files but a few, like klogd, ntpd and watchdog, do not.
> > We add write_pidfile() for these as is done for syslogd.
> 
>  Please don't, or at the very least, make it optional.
> 
>  1. PID files are a horrible hack coming from the Stone Age of Unix, and
> they should be well on their way to oblivion by now. They have never been
> reliable, they have been the bane of countless system administrators, and
> they have prevented people from clean daemon handling for long enough.
>  The right way to manage daemons is via supervision systems; even
> mainstream Linux distributions like RedHat and Ubuntu have finally
> figured that out and come with a "init" system that performs supervision,
> and that does not need PID files.
>  The write_pidfile() function should be marked as legacy, and hopefully
> disappear in a future version of Busybox.
> 
>  2. Even if you are running a legacy init system with no control over
> your daemons, making a shell script to get the PID of the process you
> are launching and write it to a file is easy enough. System V init has
> done this for decades. No need to bloat the applets' code with
> functionality that is so easy to script.
> 
>  I am regularly using a few busybox applets as daemons - watchdog, for
> instance. I will consider it a net quality drop in Busybox if those
> daemons start writing pidfiles, 

Hi,
couldn't we make it a config option?
Eventually also for syslogd.

> which are just white noise on my
> systems, and potentially dangerous (what if I have no /var/run ?

Change the path, that's why i suggested to move the hardcoded
paths to libbb.h so that you can see them all at once.

> should the applet crash for failing to do something I don't need ? or should
> it silently fail, and then also silently fail in situations when it
> *should* report an error, on systems that use the feature ?)

If CONFIG__XXX_PIDFILE is enabled and something goes wrong complain loudly
else  there will be silence.

Just my 0,2 cents.
Ciao,
Tito




More information about the busybox mailing list