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

Re: start-stop-daemon



Previously Roland Mas wrote:
> Yeah, but the daemon might have died unexpectedly.  Some basic check
> could be that there indeed *is* a process by that pid.

What for? If the process is dead we catch that situation when we
try to kill it. In fact that is the only safe way to do that check
anyway, anything else is a race.

> It could even compare the name of that process with what it should be.

Certainly not, any process can change its name at will, it simply is
not a useful way to identify a process.

> It might even compare the mtime/ctime of the file with the start time
> of the process.

I suspect you mean atime? If you know the file use the --exec option
which does a device/inode comparison which is a lot safer. Not all
filesystems store the atime, or it might be disabled.

Wichert.

-- 
  _________________________________________________________________
 /       Nothing is fool-proof to a sufficiently talented fool     \
| wichert@wiggy.net                   http://www.liacs.nl/~wichert/ |
| 1024D/2FA3BC2D 576E 100B 518D 2F16 36B0  2805 3CB8 9250 2FA3 BC2D |



Reply to: