]> 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>
Sat, 28 Aug 2010 02:17:03 +0000 (19:17 -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 8b53f367c8b815cb3c34846e19f02df3f8dd4cfc..451a0286d83490a57fc8c08d769279e8a4a3abdc 100644 (file)
@@ -1,3 +1,12 @@
+openafs (1.5.75-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, 27 Aug 2010 19:15:56 -0700
+
 openafs (1.5.75-2) experimental; urgency=low
 
   * Apply upstream deltas:
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