NetBSD Problem Report #23389

Received: (qmail 20523 invoked by uid 605); 7 Nov 2003 19:11:02 -0000
Message-Id: <20031107191049.A657E6688C@sonic.wsrcc.com>
Date: Fri,  7 Nov 2003 11:10:49 -0800 (PST)
From: wolfgang@wsrcc.com
Sender: gnats-bugs-owner@NetBSD.org
Reply-To: wolfgang@wsrcc.com
To: gnats-bugs@gnats.netbsd.org
Subject: /etc/daily needs lockfile
X-Send-Pr-Version: 3.95

>Number:         23389
>Category:       bin
>Synopsis:       /etc/daily needs lockfile
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Nov 07 19:12:01 +0000 2003
>Closed-Date:    
>Last-Modified:  
>Originator:     Wolfgang S. Rupprecht
>Release:        NetBSD 1.6ZE
>Organization:
W S Rupprecht Computer Consulting, Fremont CA
>Environment:


System: NetBSD capsicum.wsrcc.com 1.6ZE NetBSD 1.6ZE (WSRCC_ATHLON) #6: Mon Nov 3 08:56:59 PST 2003 wolfgang@capsicum.wsrcc.com:/var/obj/netbsd/sys/arch/i386/compile/WSRCC_ATHLON i386
Architecture: i386
Machine: i386
>Description:

	/etc/daily can hang under some circumstances.  (Such as 
	"df" hanging when the server for an imported nfs-filesystem is
	offline.)

	When the stuck nfs server is brought back online all the
	wedged /etc/daily's race it out and trip all over each other.

>How-To-Repeat:

	mount some-rarely-used-server:/mnt
	shutdown  some-rarely-used-server
	wait 2 days.
	power up some-rarely-used-server
	watch the fun begin.

>Fix:



--- /usr/src/etc/daily	2003-10-01 11:41:46.000000000 -0700
+++ /etc/daily	2003-11-07 11:04:27.000000000 -0800
@@ -11,6 +11,16 @@
 	. /etc/daily.conf
 fi

+LOCK=/var/run/root-daily.pid
+
+if [ -f $LOCK ]
+then
+    echo "LOCKED: $LOCK exists"
+else
+    echo "$$" > $LOCK
+
+
+
 host=`hostname`
 date=`date`

@@ -252,3 +262,6 @@
 	echo "Running /etc/daily.local:"
 	. /etc/daily.local
 fi
+
+    /bin/rm -f $LOCK
+fi
--- /usr/src/etc/weekly	2001-06-18 03:54:02.000000000 -0700
+++ /etc/weekly	2003-11-07 11:04:20.000000000 -0800
@@ -11,6 +11,14 @@
 	. /etc/weekly.conf
 fi

+LOCK=/var/run/root-weekly.pid
+
+if [ -f $LOCK ]
+then
+    echo "LOCKED: $LOCK exists"
+else
+    echo "$$" > $LOCK
+
 host=`hostname`
 date=`date`

@@ -78,3 +86,6 @@
 	echo "Running /etc/weekly.local:"
 	. /etc/weekly.local
 fi
+
+    /bin/rm -f $LOCK
+fi
--- /usr/src/etc/monthly	2000-01-10 09:03:49.000000000 -0800
+++ /etc/monthly	2003-11-07 11:04:12.000000000 -0800
@@ -11,6 +11,14 @@
 	. /etc/monthly.conf
 fi

+LOCK=/var/run/root-monthly.pid
+
+if [ -f $LOCK ]
+then
+    echo "LOCKED: $LOCK exists"
+else
+    echo "$$" > $LOCK
+
 host=`hostname`
 date=`date`

@@ -27,3 +35,6 @@
 	echo "Running /etc/monthly.local:"
 	. /etc/monthly.local
 fi
+
+    /bin/rm -f $LOCK
+fi

>Release-Note:
>Audit-Trail:
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.