]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
* When kill_all_afs is enabled in /etc/openafs/afs.conf, only kill AFS
authorRuss Allbery <rra@debian.org>
Fri, 9 Sep 2005 09:08:38 +0000 (09:08 +0000)
committerRuss Allbery <rra@debian.org>
Fri, 9 Sep 2005 09:08:38 +0000 (09:08 +0000)
    processes if the runlevel is 0 or 6.  You really only want this when
    the system is shutting down.  (Closes: #325347)

debian/afs.conf
debian/changelog
debian/openafs-client.init

index 48fe9441f83d096d90f3d987e4a4e5256e4cb2af..64490a1bd98f7b17b63d0789b999b26b561abf88 100644 (file)
@@ -117,12 +117,13 @@ AFS_PRE_SHUTDOWN=
 # If you are having problems with AFS shutting down cleanly or the system not
 # rebooting because the partition the AFS cache was on could not be unmounted,
 # try installing lsof and uncommenting this.  This will cause all processes
-# with open AFS files to be killed before unmounting AFS.
+# with open AFS files to be killed before unmounting AFS if the runlevel being
+# switched to is 0 or 6.
 #
 # Warning: This means /etc/init.d/openafs-client stop will kill all processes
 # with files open in AFS rather than returning an error saying the file system
-# is busy.  This is what you want when the whole system is shutting down, but
-# often *not* what you want when just stopping and restarting the client.
-# OpenAFS has no way of distinguishing between those two cases.  Only enable
-# this if you're certain it's what you want.
+# is busy.  This is probably what you want when the whole system is shutting
+# down, but often *not* what you want when just stopping and restarting the
+# client.  The code doesn't run unless the runlevel is 0 or 6, but still, be
+# sure that this is what you want before enabling it.
 #AFS_PRE_SHUTDOWN=kill_all_afs
index 78caceacb90ab629e583107887a4df0e9f87e986..3105b3c60dad39289ae5ab37727adddc75420bcc 100644 (file)
@@ -1,6 +1,9 @@
 openafs (1.4rc3-1) unstable; urgency=low
 
   * New upstream version.
+  * When kill_all_afs is enabled in /etc/openafs/afs.conf, only kill AFS
+    processes if the runlevel is 0 or 6.  You really only want this when
+    the system is shutting down.  (Closes: #325347)
   * Translation updates.
     - Portuguese (Brazil), thanks André Luís Lopes.
 
index 37f40c4e07148db2ce12c5d3066f00ae9eae3fd4..d77afc2261055fb937390014151c208e4fde4c95 100755 (executable)
@@ -173,18 +173,20 @@ kill_afs() {
 }
 
 # Repeatedly call kill_afs for a series of signals to give AFS-using processes
-# a hope of shutting down cleanly.  Not enabled by default.  Enable this in
-# /etc/openafs/afs.conf (but see the warning in that file).
+# a hope of shutting down cleanly if the system is shutting down.  Not enabled
+# by default.  Enable this in /etc/openafs/afs.conf.
 kill_all_afs() {
-    if [ -x /usr/bin/lsof ] ; then
-        echo -n "Killing processes with AFS files open: "
-        kill_afs HUP
-        kill_afs TERM
-        kill_afs ABRT
-        kill_afs KILL
-        echo "done."
-    else
-        echo '/usr/bin/lsof not found, not killing processes' >&2
+    if [ "$RUNLEVEL" -eq 0 ] || [ "$RUNLEVEL" -eq 6 ] ; then
+        if [ -x /usr/bin/lsof ] ; then
+            echo -n "Killing processes with AFS files open: "
+            kill_afs HUP
+            kill_afs TERM
+            kill_afs ABRT
+            kill_afs KILL
+            echo "done."
+        else
+            echo '/usr/bin/lsof not found, not killing processes' >&2
+        fi
     fi
 }