]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
- skip dead pids in status() with --pidfile, or is filter_chroot() broken by design?
authorElan Ruusamäe <glen@pld-linux.org>
Mon, 8 Feb 2010 17:11:41 +0000 (17:11 +0000)
committerElan Ruusamäe <glen@pld-linux.org>
Mon, 8 Feb 2010 17:11:41 +0000 (17:11 +0000)
svn-id: @11136

rc.d/init.d/functions

index f219374c2e802c6899e9000eedc9aac73201df1f..03efec83a290b87b81b0079f0a9a5f23f963e607 100644 (file)
@@ -833,6 +833,10 @@ status() {
        # if pidfile specified, pid must be there
        if [ "$pidfile" ]; then
                [ -f "$pidfile" ] && read pid < $pidfile
+               # filter_chroot does not filter out dead pids, so this extra check, see t/status-pidfile.sh
+               if [ ! -d "/proc/$pid" ]; then
+                       pid=
+               fi
        else
                pid=$(pidof -o $$ -o $PPID -o %PPID -x $daemon)
        fi
This page took 0.058471 seconds and 4 git commands to generate.