From: Pete Zaitcev Subject: [tabled patch 2/2] test/start-daemon: Ignore stale .pid files. Date: Wed, 22 Sep 2010 17:15:54 -0600 Message-ID: <20100922171554.07c7d687@lembas.zaitcev.lan> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: Sender: hail-devel-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii" To: Jeff Garzik Cc: zaitcev@redhat.com, Jim Meyering , Project Hail List 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 Signed-off-by: Pete Zaitcev --- 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