]> spindle.queued.net Git - autox/blob - debian/autox.init
don't let debhelper override our init script settings
[autox] / debian / autox.init
1 #! /bin/sh
2 ### BEGIN INIT INFO
3 # Provides:          autox
4 # Required-Start:    $local_fs $remote_fs
5 # Required-Stop:     $local_fs $remote_fs
6 # Default-Start:     2 3 4 5
7 # Default-Stop:      0 1 6
8 # Short-Description: Automatically start X on boot
9 ### END INIT INFO
10 #
11 # Author:            Andres Salomon <dilinger@debian.org> 
12 #
13
14 set -e
15
16 PATH=/sbin:/bin:/usr/sbin:/usr/bin
17 DAEMON=/usr/sbin/autox
18 PIDFILE=/var/run/autox.pid
19 NAME=autox
20 DESC=autox
21
22 test -x $DAEMON || exit 0
23
24 . /lib/lsb/init-functions
25
26 AUTOX_USER=""
27 if [ -f /etc/default/$NAME ] ; then
28         . /etc/default/$NAME
29 fi
30
31 if [ -z "$AUTOX_USER" ]; then
32         log_failure_msg "No user specified in /etc/default/${NAME}"
33         exit 0
34 fi
35
36 case "$1" in
37  start)
38         log_daemon_msg "Starting $DESC" "$NAME"
39 #x=$(readlink -f /dev/stdin)
40 #echo "stdin: $x" > /tmp/blah
41 #chown olpc /dev/tty7
42 # -- /dev/tty7
43         #start-stop-daemon --start --chuid olpc --verbose --background --make-pidfile --pidfile $PIDFILE --user olpc --exec $DAEMON -- /dev/tty7
44 #start-stop-daemon --start --verbose --background --make-pidfile --pidfile $PIDFILE --exec $DAEMON -- /dev/tty7
45         start-stop-daemon --start --background --pidfile $PIDFILE \
46                         --exec $DAEMON -- $AUTOX_USER
47
48         #start-stop-daemon --start --quiet --exec $DAEMON -- $DAEMON_OPTS &
49         log_end_msg $?
50         ;;
51  stop)
52         log_daemon_msg "Stopping $DESC" "$NAME"
53         start-stop-daemon --stop --quiet --pidfile $PIDFILE --oknodo
54         log_end_msg $?
55         ;;
56  restart|force-reload)
57         $0 stop
58         sleep 1
59         $0 start
60         ;;
61  *)
62         N=/etc/init.d/$NAME
63         echo "Usage: $N {start|stop|restart|force-reload}" >&2
64         exit 1
65         ;;
66 esac
67
68 exit 0