[tabled patch 2/2] test/start-daemon: Ignore stale .pid files.

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

 



The effect of this is to proceed with "make check" if
 - stale file is present, and
 - no process uses the PID recorded therein.
So, the worst that can happen is a revert to old behavior if an unrelated
process reuses the PID. Should make no difference for RPM builds at all.

Signed-off-by: Jim Meyering <meyering@xxxxxxxxxx>
Signed-off-by: Pete Zaitcev <zaitcev@xxxxxxxxxx>

---
 test/start-daemon |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

You know, if we decide that we want to permit "make check" on unclean tree
(which is where this patch aims), we might want to rm -r test/data too.
Otherwise code 1111 lock conflicts are inevitable and check is likely
to fail anyway.

diff --git a/test/start-daemon b/test/start-daemon
index da653d6..6985468 100755
--- a/test/start-daemon
+++ b/test/start-daemon
@@ -1,10 +1,14 @@
 #!/bin/sh
 
-for d in cld chunkd tabled; do
+for d in cld chunkd tabled
+do
 	if [ -f $d.pid ]
 	then
-		echo "$d.pid file found.  daemon still running?"
-		exit 1
+		if kill -0 `cat $d.pid` 2> /dev/null
+		then
+			echo "$d.pid file found.  daemon still running?" >&2
+			exit 1
+		fi
 	fi
 done
 
--
To unsubscribe from this list: send the line "unsubscribe hail-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Fedora Clound]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux