]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
openafs-fileserver init script improvements
authorRuss Allbery <rra@debian.org>
Fri, 30 Jul 2010 22:41:34 +0000 (15:41 -0700)
committerRuss Allbery <rra@debian.org>
Fri, 30 Jul 2010 22:41:34 +0000 (15:41 -0700)
* The openafs-fileserver init script now depends on $named since
  apparently the volserver requires DNS during startup.  Thanks, Jaap
  Winius.  (Closes: #589783)
* Add a status command to thet openafs-fileserver init script.

debian/changelog
debian/openafs-fileserver.init

index 1d52c09dfea8f49fa1f333dbf1f17cf64c0f70ae..decf96ed124ea56f627073a10af702363f06026d 100644 (file)
@@ -1,3 +1,12 @@
+openafs (1.4.12.1+dfsg-3) UNRELEASED; urgency=low
+
+  * The openafs-fileserver init script now depends on $named since
+    apparently the volserver requires DNS during startup.  Thanks, Jaap
+    Winius.  (Closes: #589783)
+  * Add a status command to thet openafs-fileserver init script.
+
+ -- Russ Allbery <rra@debian.org>  Fri, 30 Jul 2010 15:41:16 -0700
+
 openafs (1.4.12.1+dfsg-2) unstable; urgency=low
 
   * Apply upstream deltas to fix crashes in the file server:
index 5db046378cf16f071d2a3e37f5d67de1b15d2449..ea1b41fe89e6263977fdd24811152baea56e15ce 100755 (executable)
@@ -1,8 +1,8 @@
 #! /bin/sh
 ### BEGIN INIT INFO
 # Provides:             openafs-fileserver
-# Required-Start:       $local_fs $remote_fs $network $time
-# Required-Stop:        $local_fs $remote_fs $network
+# Required-Start:       $remote_fs $network $time $named
+# Required-Stop:        $remote_fs $network
 # Default-Start:        2 3 4 5
 # Default-Stop:         0 1 6
 # Short-Description:    OpenAFS file and database server manager
@@ -25,8 +25,10 @@ DAEMON=/usr/sbin/bosserver
 DAEMON_ARGS=""
 SCRIPTNAME=/etc/init.d/openafs-fileserver
 
-# Exit if the package is not installed.
-[ -x "$DAEMON" ] || exit 0
+# Exit if the package is not installed and we were not given the status option.
+if [ ! -x "$DAEMON" ] && [ "status" != "$1" ] ; then
+    exit 0
+fi
 
 # Read configuration if it is present.
 [ -r /etc/default/openafs-fileserver ] && . /etc/default/openafs-fileserver
@@ -109,8 +111,27 @@ case "$1" in
     esac
     ;;
 
+  status)
+    start-stop-daemon --start --quiet --startas $DAEMON --name $NAME --test \
+        > /dev/null
+    case "$?" in
+      0)
+        echo "$NAME is not running"
+        exit 3
+        ;;
+      1)
+        echo "$NAME is running"
+        exit 0
+        ;;
+      *)
+        log_warning_msg "Cannot determine if $NAME is running"
+        exit 4
+        ;;
+    esac
+    ;;
+
   *)
-    echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
+    echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2
     exit 3
     ;;
 esac