4 # Required-Start: $local_fs $remote_fs $network $syslog
5 # Required-Stop: $local_fs $remote_fs $network $syslog
6 # Default-Start: 2 3 4 5
8 # Short-Description: Start/Stop the mogilefsd daemon
9 # Description: Start/Stop the mogilefsd daemon.
12 # PATH should only include /usr/* if it runs after the mountnfs.sh script
13 PATH
=/usr
/local
/sbin
:/usr
/local
/bin
:/sbin
:/bin
:/usr
/sbin
:/usr
/bin
14 DAEMON
=/usr
/bin
/mogilefsd
17 DEFAULTS
=/etc
/default
/$NAME
19 PIDFILE
=$PIDDIR/$NAME.pid
20 SCRIPTNAME
=/etc
/init.d
/$NAME
22 # Exit if the package is not installed
23 [ -x "$DAEMON" ] ||
exit 0
25 # Read configuration variable file if it is present
26 if [ -r $DEFAULTS ] ; then
30 if [ -z "$MOGILEFSD_RUNASUSER" ]; then
31 echo "Cannot determine user to run as, even though defaults file ($DEFAULTS) exists."
32 echo "Please run dpkg-reconfigure $NAME to correct the problem."
36 echo "Can't start $NAME. Defaults file ($DEFAULTS) doesn't exist."
37 echo "Please run dpkg-reconfigure $NAME to correct the problem."
41 # Load the VERBOSE setting and other rcS variables
47 # Function that starts the daemon/service
52 if ! test -d ${PIDDIR}
55 chown
${MOGILEFSD_RUNASUSER} ${PIDDIR}
61 if [ -d /proc
/`cat $PIDFILE`/ ]
64 echo "$NAME already running."
72 start-stop-daemon
--start --quiet --exec $DAEMON -b --name $NAME --chuid $MOGILEFSD_RUNASUSER -- $MOGILEFSD_EXTRA_OPTS
76 # Function that stops the daemon/service
80 start-stop-daemon
--stop --quiet --oknodo --pidfile $PIDFILE --name $NAME --user $MOGILEFSD_RUNASUSER
86 echo -n "Starting $DESC: "
91 echo -n "Stopping $DESC: "
98 # If the "reload" option is implemented, move the "force-reload"
99 # option to the "reload" entry above. If not, "force-reload" is
100 # just the same as "restart".
102 echo -n "Restarting $DESC: "
109 #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
110 echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2