[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: start-stop-daemon : strange behavior



On Mon, May 29, 2000 at 05:54:31PM +0200, Thierry Laronde wrote:
> 
> The behavior is definitively strange, because it's a bit random. On my
> two PCs, start-stop-daemon always returns 0 if it can't kill a process.
> 
> But when it returns 1, that's _not_ because it can kill the process, but
> because it can't open the pidfile. So the 1 return is only a side
> effect, and the fact is that some pidfiles are deleted when the process
> are killed, and some not.
> 
> For example, if I invoke start-stop-daemon --pidfile atd.pid --stop, the
> process is stopped AND the pidfile is removed (but with strace, it seems
> that this is not a direct action of start-stop-daemon). But with
> sendmail.pid, the pidfile is not removed, so the second call of
> start-stop-daemon failed (unable to kill the process), but returns 0.

The reason is quite simple : the pidfile is deleted by the daemon
itself, when the daemon handles a pidfile. When the daemon doesn't
handle it, the pidfile remains, and start-stop-daemon behaves
abnormally.
-- 
Thierry LARONDE <thierry.laronde@polynum.com>
10, rue du Bel Air, 74000 ANNECY / Tel.-Fax : 33.(0)4.50.67.46.61
website : http://www.polynum.com
/home du SDF (Site Debian Francophone) : http://www.polynum.com/debian/



Reply to: