From 74370630f38feb703c48eb80fe9e79c3da95b3a1 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Fri, 9 Sep 2005 09:08:38 +0000 Subject: [PATCH] * 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) --- debian/afs.conf | 11 ++++++----- debian/changelog | 3 +++ debian/openafs-client.init | 24 +++++++++++++----------- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/debian/afs.conf b/debian/afs.conf index 48fe9441f..64490a1bd 100644 --- a/debian/afs.conf +++ b/debian/afs.conf @@ -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 diff --git a/debian/changelog b/debian/changelog index 78caceacb..3105b3c60 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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. diff --git a/debian/openafs-client.init b/debian/openafs-client.init index 37f40c4e0..d77afc226 100755 --- a/debian/openafs-client.init +++ b/debian/openafs-client.init @@ -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 } -- 2.39.5