3 # Provides: openafs-fileserver
4 # Required-Start: $remote_fs $network $time $named
5 # Required-Stop: $remote_fs $network
6 # Default-Start: 2 3 4 5
8 # Short-Description: OpenAFS file and database server manager
9 # Description: Starts, stops, or restarts the OpenAFS bosserver,
10 # which is the process that starts and manages the
11 # OpenAFS file server or database servers depending on
15 # Author: Sam Hartman <hartmans@mit.edu>
16 # Author: Russ Allbery <rra@debian.org>
18 # Based on the /etc/init.d/skeleton template as found in initscripts version
21 PATH=/sbin:/bin:/usr/sbin:/usr/bin
22 DESC="OpenAFS BOS server"
24 DAEMON=/usr/sbin/bosserver
26 SCRIPTNAME=/etc/init.d/openafs-fileserver
28 # Exit if the package is not installed and we were not given the status option.
29 if [ ! -x "$DAEMON" ] && [ "status" != "$1" ] ; then
33 # Read configuration if it is present.
34 [ -r /etc/default/openafs-fileserver ] && . /etc/default/openafs-fileserver
36 # Get the setting of VERBOSE and other rcS variables.
37 [ -f /etc/default/rcS ] && . /etc/default/rcS
39 # Define LSB log functions (requires lsb-base >= 3.0-6).
40 . /lib/lsb/init-functions
42 # Make sure we don't leave file descriptors open.
47 # 0 if daemon has been started
48 # 1 if daemon was already running
49 # 2 if daemon could not be started
52 start-stop-daemon --start --quiet --startas $DAEMON --name $NAME --test \
53 > /dev/null || return 1
54 start-stop-daemon --start --quiet --startas $DAEMON --name $NAME \
55 -- $DAEMON_ARGS || return 2
59 # 0 if daemon has been stopped
60 # 1 if daemon was already stopped
61 # 2 if daemon could not be stopped
62 # other if a failure occurred
65 start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME
70 [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
73 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
74 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
79 [ "$VERBOSE" != no ] && log_action_msg "Stopping OpenAFS services"
80 bos shutdown localhost -wait -localauth
81 [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
84 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
85 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
90 [ "$VERBOSE" != no ] && log_daemon_msg "Restarting $DESC" "$NAME"
91 start-stop-daemon --start --quiet --startas $DAEMON --name $NAME --test \
97 0) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
98 *) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
102 bos restart localhost -all -bosserver -localauth
104 0) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
105 *) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
115 start-stop-daemon --start --quiet --startas $DAEMON --name $NAME --test \
119 echo "$NAME is not running"
123 echo "$NAME is running"
127 log_warning_msg "Cannot determine if $NAME is running"
134 echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2