1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
|
#!/bin/sh -e
### BEGIN INIT INFO
# Provides: prelude-lml
# Required-Start: $syslog $remote_fs
# Required-Stop: $syslog $remote_fs
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start prelude-lml sensor
### END INIT INFO
test $DEBIAN_SCRIPT_DEBUG && set -v -x
NAME=prelude-lml
PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/usr/bin/prelude-lml
PIDFILE=/var/run/$NAME.pid
DAEMONARGS="-d -q -P /var/run/$NAME.pid"
trap "" 1
export LANG=C
export PATH
test -f $DAEMON || exit 0
check_prelude_profile()
{
if [ ! -d "/etc/prelude/profile/$NAME" ]; then
echo "Prelude profile for $NAME was not found"
echo "You must create it with prelude-admin (see README.Debian)"
echo "NOT starting."
# do not return with an error, this would prevent package installation
exit 0
fi
}
case "$1" in
start)
echo -n "Starting Prelude LML: "
check_prelude_profile
start-stop-daemon --start --pidfile $PIDFILE --exec $DAEMON --oknodo \
--quiet -- $DAEMONARGS > /dev/null
echo "$NAME."
;;
stop)
echo -n "Stopping Prelude LML: "
start-stop-daemon --stop --pidfile $PIDFILE --exec $DAEMON --quiet \
--oknodo > /dev/null
echo "$NAME."
;;
restart|force-restart|reload|force-reload)
echo -n "Restarting Prelude LML: "
check_prelude_profile
start-stop-daemon --stop --pidfile $PIDFILE --exec $DAEMON --quiet \
--oknodo > /dev/null
start-stop-daemon --start --pidfile $PIDFILE --exec $DAEMON --oknodo \
--quiet -- $DAEMONARGS > /dev/null
echo "$NAME."
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
if [ $? -eq 0 ]; then
echo .
exit 0
else
echo failed
exit 1
fi
|