]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Make openafs-client start succeed silently when already running
authorBenjamin Kaduk <kaduk@mit.edu>
Wed, 29 Oct 2014 19:59:43 +0000 (15:59 -0400)
committerBenjamin Kaduk <kaduk@mit.edu>
Thu, 30 Oct 2014 20:50:24 +0000 (16:50 -0400)
This is what we have to do, since we use dh_installinit -r.

debian/changelog
debian/openafs-client-precheck

index d7396da7037acf497892981b523a4e2772df1ea7..4355a77c697a42b215e8aced2d5e3f3b7d2f93b9 100644 (file)
@@ -2,6 +2,8 @@ openafs (1.6.10-2) UNRELEASED; urgency=medium
 
   * Some shell quoting and similar cleanups in openafs-client-precheck
     from Anders Kaseorg.
+  * Make the openafs-client unit silently succeed when it is already
+    running, to match the behavior of the sysV script. (Closes: #767056)
 
  -- Benjamin Kaduk <kaduk@mit.edu>  Tue, 28 Oct 2014 18:52:47 -0400
 
index 877140e17e9664cb384a48999496ad2d6b364702..60299893c7af7bb740442fb0d23518ba04e3414c 100755 (executable)
@@ -9,6 +9,15 @@ fi
 CACHEINFO=${CACHEINFO:-/etc/openafs/cacheinfo}
 MODULEROOT=${MODULEROOT:-/lib/modules/`uname -r`}
 
+do_nothing_env() {
+    cat > /var/cache/openafs-client/openafs-client.env <<EOF
+AFSD_ARGS=-exit
+AFS_SETCRYPT=-help
+AFS_SYSNAME=-help
+KMOD=--version
+EOF
+}
+
 # Exit if the package is not installed.
 [ -x /sbin/afsd ] || exit 1
 
@@ -22,8 +31,9 @@ if ! [ -d "$(awk -F : '{print $1}' < "${CACHEINFO}")" ]; then
     exit 1
 fi
 if pidof /sbin/afsd || pidof /usr/sbin/afsd; then
-    echo "afsd is already running?" >&2
-    exit 1
+    echo "afsd is already running, continuing" >&2
+    do_nothing_env
+    exit 0
 fi
 
 # Ensure that the kernel module is loaded.
@@ -38,12 +48,7 @@ if ! /sbin/lsmod | grep -Fq openafs; then
        if grep -q openafs "$MODULEROOT/modules.dep"; then
            exit $status
        else
-           cat > /var/cache/openafs-client/openafs-client.env <<EOF
-AFSD_ARGS=-exit
-AFS_SETCRYPT=-help
-AFS_SYSNAME=-help
-KMOD=--version
-EOF
+           do_nothing_env
            exit 0
        fi
     fi