Pavlos Parissis Posted October 7, 2010 Report Share Posted October 7, 2010 Hi, As the title states the pid file is not removed when you stop pbx, see below [root@node-01 pbxnsip]# ./pbx_01 --pidfile /var/run/pbx_01.pid [root@node-01 pbxnsip]# pidof -c -o $$ -o $PPID -o %PPID -x pbx_01 15791 [root@node-01 pbxnsip]# cat /var/run/pbx_01.pid 15791[root@node-01 pbxnsip]# [root@node-01 pbxnsip]# ps -ef|grep pbx_01 root 15791 1 1 15:57 pts/0 00:00:00 ./pbx_01 --pidfile /var/run/pbx_01.pid root 16296 23656 0 15:57 pts/0 00:00:00 grep pbx_01 [root@node-01 pbxnsip]# kill -TERM 15791 [root@node-01 pbxnsip]# cat /var/run/pbx_01.pid 1579 [root@node-01 pbxnsip]# pidof -c -o $$ -o $PPID -o %PPID -x pbx_01 [root@node-01 pbxnsip]# ps -ef|grep pbx_01 root 16895 23656 0 15:58 pts/0 00:00:00 grep pbx_01 [root@node-01 pbxnsip]# ./pbx_01 --version Version: 3.4.0.3201 The LSB specification states that "When a program is stopped, it should delete its pidfile" Does anyone know if this is solved in any newer releases? Quote Link to comment Share on other sites More sharing options...
Vodia PBX Posted October 8, 2010 Report Share Posted October 8, 2010 The LSB specification states that "When a program is stopped, it should delete its pidfile" Hmm. When the program receives a signal, it usually performs the default action. In other words when it crashes, it does not delete the PID file... Maybe we have to define what signal should be used to shut the service down and then the pidfile can be deleted in a controlled way. Quote Link to comment Share on other sites More sharing options...
Pavlos Parissis Posted October 8, 2010 Author Report Share Posted October 8, 2010 Hmm. When the program receives a signal, it usually performs the default action. In other words when it crashes, it does not delete the PID file... Maybe we have to define what signal should be used to shut the service down and then the pidfile can be deleted in a controlled way. when a program crashes, I don't expect to remove the pid file. But if it is terminated gracefully, normal stop, I expect the pid file to be removed. The presents of a pid file on unix systems is quite significant. Nevertheless, I managed to do my work even with this behavior. I created a LSB compliant init script for pbx, I had to that because the current scripts on the site aren't and it was a requirement from the cluster software to use LSB compliant init script. Quote Link to comment Share on other sites More sharing options...
ndemou Posted October 8, 2010 Report Share Posted October 8, 2010 [...][root@node-01 pbxnsip]# kill -TERM 15791 looking at my init script[2] of pbxnsip I see it uses the killproc funtion[1] which first sends a TERM signal then deletes the pid file. Nick _____________________ [1] have a look at /etc/rc.d/init.d/functions [2] ... stop() { echo -n "Stopping pbxnsip Watchdog:" killproc $PBXWD -TERM echo RETVAL=1 } ... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.