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
|
#!/bin/sh
#
### BEGIN INIT INFO
# Provides: fso-frameworkd frameworkd
# Required-Start: $remote_fs dbus
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: freesmartphone.org framework daemon
# Description: Python based legacy implementation of freesmartphone.org services
### END INIT INFO
set -e
PATH=/bin:/usr/bin:/sbin:/usr/sbin
DESC="freesmartphone.org framework daemon"
NAME=frameworkd
DAEMON=/usr/bin/frameworkd
PIDDIR=/var/run/
PIDFILE=${PIDDIR}/${NAME}.pid
CONFFILE=/etc/frameworkd.conf
# Gracefully exit if the package has been removed (but not purged).
[ -x "$DAEMON" ] || exit 0
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
# Define LSB log_* functions.
. /lib/lsb/init-functions
case "$1" in
start)
if [ ! -r "$CONFFILE" ]; then
echo "No $CONFFILE found, frameworkd cannot start."
echo
echo "Please read /usr/share/doc/fso-frameworkd/README.Debian."
exit 0
fi
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
start-stop-daemon --start --pidfile ${PIDFILE} --make-pidfile --background --exec ${DAEMON}
[ "$VERBOSE" != no ] && log_end_msg $?
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
start-stop-daemon --stop --pidfile ${PIDFILE} --oknodo
[ "$VERBOSE" != no ] && log_end_msg $?
;;
status)
start-stop-daemon --status --pidfile ${PIDFILE}
STATUS=$?
if [ $STATUS -neq 0 ] ; then
[ "$VERBOSE" != no ] && log_daemon_msg "$DESC is not running"
else
[ "$VERBOSE" != no ] && log_daemon_msg "$DESC is running"
fi
exit $STATUS
;;
restart|force-reload)
$0 stop
$0 start
;;
*)
log_success_msg "Usage: $0 {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0
|