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
18 PIDFILE
=/var
/run
/$NAME.pid
19 SCRIPTNAME
=/etc
/init.d
/$NAME
21 # Exit if the package is not installed
22 [ -x "$DAEMON" ] ||
exit 0
24 # Read configuration variable file if it is present
25 if [ -r $DEFAULTS ] ; then
29 if [ -z "$MOGILEFSD_RUNASUSER" ]; then
30 echo "Cannot determine user to run as, even though defaults file ($DEFAULTS) exists."
31 echo "Please run dpkg-reconfigure $NAME to correct the problem."
35 echo "Can't start $NAME. Defaults file ($DEFAULTS) doesn't exist."
36 echo "Please run dpkg-reconfigure $NAME to correct the problem."
40 # Load the VERBOSE setting and other rcS variables
46 # Function that starts the daemon/service
53 if [ -d /proc
/`cat $PIDFILE`/ ]
56 echo "$NAME already running."
64 start-stop-daemon
--start --quiet --exec $DAEMON --pidfile $PIDFILE -b -m --name $NAME --chuid $MOGILEFSD_RUNASUSER
68 # Function that stops the daemon/service
72 start-stop-daemon
--stop --quiet --oknodo --pidfile $PIDFILE --name $NAME --user $MOGILEFSD_RUNASUSER
78 echo -n "Starting $DESC: "
83 echo -n "Stopping $DESC: "
90 # If the "reload" option is implemented, move the "force-reload"
91 # option to the "reload" entry above. If not, "force-reload" is
92 # just the same as "restart".
94 echo -n "Restarting $DESC: "
101 #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
102 echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2