The .pid file is not removed automatically

Richard G

Verified User
Joined
Jul 6, 2008
Messages
12,563
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?
 
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
 
Back
Top