The .pid file is not removed automatically

Richard G

Verified User
Joined
Jul 6, 2008
Messages
4,510
Location
Maastricht
I thought when you put a .pid file in the /var/run directory, it would be automatically removed after the service is stopped or the server is rebooted the nice way.

However, with directslave I came to the conclusion that it does not remove the pid file, and does not after rebooting the server.
So at this moment in the /etc/rc.d/init.d/directslave script I put a rm command to remove the pid file after killing the process.

But I doubt if that is the correct way. Or is there another cause the pid won't be removed?
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
14,243
Location
GMT +7.00
Hello Richard,

It's a daemon's care to clear a pid file after it exited or was terminated. Thus you probably should contact the developer of
directslave for a fix. Probably this module could be used http://search.cpan.org/~awrigley/Proc-Pidfile-1.004/Pidfile.pm
 
Top