source: epoptes/trunk/fuentes/debian/epoptes.init @ 295

Last change on this file since 295 was 295, checked in by mabarracus, 3 years ago

copy trusty epoptes code

File size: 1.7 KB
Line 
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides:          epoptes
4# Required-Start:    $network $remote_fs $syslog
5# Required-Stop:     $network $remote_fs $syslog
6# Default-Start:     2 3 4 5
7# Default-Stop:      0 1 6
8# Short-Description: Epoptes service
9# Description:       A twisted-based daemon that manages epoptes-client
10#                    and GUI connections.
11### END INIT INFO
12
13PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
14DAEMON=/usr/bin/python
15PIDFILE=/var/run/epoptes.pid
16LOGFILE=/var/log/epoptes.log
17DESC="Epoptes service"
18
19# If this is an LTSP client, then only run the service if EPOPTES=True
20if egrep -qs 'ltsp|nfs|nbd' /proc/cmdline && [ -x /usr/bin/getltscfg ]; then
21    case "$(getltscfg EPOPTES || true)" in
22       [Tt][Rr][Uu][Ee]|[Yy]|[Yy][Ee][Ss])
23            ;;
24       *)
25            exit 0
26            ;;
27    esac
28fi
29
30. /lib/lsb/init-functions
31
32[ -e "/usr/share/n4d/python-plugins/Golem.py" ] || exit 0
33
34case "$1" in
35    start)
36       
37        log_daemon_msg "Starting the epoptes daemon"
38        start-stop-daemon --start --startas /usr/bin/twistd --quiet --oknodo --pidfile "$PIDFILE" --exec "$DAEMON" -- \
39            --pidfile "$PIDFILE" --logfile "$LOGFILE" epoptes
40        log_end_msg $?
41        ;;
42    stop)
43        log_daemon_msg "Stopping the epoptes daemon"
44        start-stop-daemon --stop --quiet --oknodo --pidfile "$PIDFILE" || true
45        log_end_msg $?
46        ;;
47    restart|force-reload)
48        "$0" stop
49        sleep 2
50        "$0" start
51        ;;
52    status)
53        status_of_proc -p $PIDFILE $DAEMON epoptes && exit 0 || exit $?
54        ;;
55    *)
56        echo "Usage: $0 {start|stop|restart|force-reload|status}" >&2
57        exit 1
58    ;;
59esac
Note: See TracBrowser for help on using the repository browser.