[LEDE-DEV] Procd instance pidfiles remain after daemon dies unexpectedly

John Crispin john at phrozen.org
Fri Jul 1 01:26:36 PDT 2016



On 01/07/2016 08:45, Jurgen Van Ham wrote:
> Dear all,
> 
> Procd supports instance_writepid and instance_removepid in the file instance.c.
> The removepid is called when stopping a daemon or restarting it.
> However, when a daemon
> dies and it is not configured to respawn the pidfile is not removed.
> 
> 
> When other daemon watch the pidfile because they rely on the daemon
> they cannot rely to stop when the pidfile disappears.  This other
> daemon cannot just continue after procd would respawn the died daemon.
> Before restarting the procd managed daemon, the depending daemons need
> to stop.
> 
> Would a fix in the function instance_exit be the right solution to
> remove the pid after dying without a configured respawn?
> Is there a reason to keep a pidfile after a daemon terminates without
> any procd request.

pidfile support was added at some point and this is a corner case that
you stumbled across that we failed to add. instance_exit() would be the
correct place to add this. having had a quick look just addin an else {}
at the end of the if clause is probably what should be done to fix this

	John



More information about the Lede-dev mailing list