4
4
# Required-Start: $local_fs $remote_fs $network $time
5
5
# Required-Stop: $local_fs $remote_fs $network
6
6
# Default-Start: 2 3 4 5
7
# Default-Stop: S 0 1 6
8
8
# Short-Description: OpenAFS file and database server manager
9
9
# Description: Starts, stops, or restarts the OpenAFS bosserver,
10
10
# which is the process that starts and manages the
11
11
# OpenAFS file server or database servers depending on
12
12
# its configuration.
15
# skeleton example file to build /etc/init.d/ scripts.
16
# This file should be used to construct scripts for /etc/init.d.
18
# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
19
# Modified for Debian GNU/Linux
20
# by Ian Murdock <imurdock@gnu.ai.mit.edu>.
22
# Version: @(#)skeleton 1.8 03-Mar-1998 miquels@cistron.nl
25
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
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"
26
24
DAEMON=/usr/sbin/bosserver
26
SCRIPTNAME=/etc/init.d/openafs-fileserver
28
# Exit if the package is not installed.
29
[ -x "$DAEMON" ] || exit 0
31
# Read configuration if it is present.
32
[ -r /etc/default/openafs-fileserver ] && . /etc/default/openafs-fileserver
34
# Get the setting of VERBOSE and other rcS variables.
35
[ -f /etc/default/rcS ] && . /etc/default/rcS
37
# Define LSB log functions (requires lsb-base >= 3.0-6).
38
. /lib/lsb/init-functions
40
# Make sure we don't leave file descriptors open.
34
test -f $DAEMON || exit 0
45
# 0 if daemon has been started
46
# 1 if daemon was already running
47
# 2 if daemon could not be started
50
start-stop-daemon --start --quiet --startas $DAEMON --name $NAME --test \
51
> /dev/null || return 1
52
start-stop-daemon --start --quiet --startas $DAEMON --name $NAME \
53
-- $DAEMON_ARGS || return 2
57
# 0 if daemon has been stopped
58
# 1 if daemon was already stopped
59
# 2 if daemon could not be stopped
60
# other if a failure occurred
63
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME
40
echo -n "Starting $DESC: "
41
start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
68
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
71
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
72
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
46
echo -n "Stopping $DESC: "
77
[ "$VERBOSE" != no ] && log_action_msg "Stopping OpenAFS services"
47
78
bos shutdown localhost -wait -localauth
48
start-stop-daemon --stop --quiet \
49
--user root --name bosserver
54
# If the daemon can reload its config files on the fly
55
# for example by sending it SIGHUP, do it here.
57
# If the daemon responds to changes in its config file
58
# directly anyway, make this a do-nothing entry.
60
# echo "Reloading $DESC configuration files."
61
# start-stop-daemon --stop --signal 1 --quiet --pidfile \
62
# /var/run/$NAME.pid --exec $DAEMON
79
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
82
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
83
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
64
87
restart|force-reload)
66
# If the "reload" option is implemented, move the "force-reload"
67
# option to the "reload" entry above. If not, "force-reload" is
68
# just the same as "restart".
70
echo -n "Restarting $DESC: "
71
if pidof $DAEMON > /dev/null ; then
72
bos restart localhost -localauth -bos
74
start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
88
[ "$VERBOSE" != no ] && log_daemon_msg "Restarting $DESC" "$NAME"
89
start-stop-daemon --start --quiet --startas $DAEMON --name $NAME --test \
95
0) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
96
*) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
100
bos restart localhost -all -bosserver -localauth
102
0) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
103
*) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
82
# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
83
echo "Usage: $N {start|stop|restart|force-reload}" >&2
113
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2