* update the changelog
[tango.git] / debian / tango-starter.init.d
blob16aa8d6b96f70d9173a4a76077eb6f43f9b31d3d
1 #! /bin/sh -e
2 ### BEGIN INIT INFO
3 # Provides: tango-starter
4 # Required-Start: $syslog
5 # Required-Stop: $syslog
6 # Should-Start: $local_fs
7 # Should-Stop: $local_fs
8 # Default-Start: 2 3 4 5
9 # Default-Stop: 0 1 6
10 # Short-Description: Start the Advanced Configuration and Power Interface daemon
11 # Description: Provide a socket for X11, hald and others to multiplex
12 # kernel ACPI events.
13 ### END INIT INFO
15 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
16 DAEMON="/usr/lib/tango/Starter"
17 DAEMON_OPTS=" 1 -ORBendPoint giop:tcp::10000"
18 NAME=tango-starter
19 DESC=tango-starter
21 test -x $DAEMON || exit 0
23 # Include tango defaults if available
24 if [ -f /etc/default/tango ] ; then
25 . /etc/default/tango
28 set -e
30 case "$1" in
31 start)
32 echo -n "Starting $DESC: "
33 start-stop-daemon --start --quiet --chuid tango:tango --background --make-pidfile --pidfile /var/run/$NAME.pid \
34 --exec $DAEMON -- $DAEMON_OPTS
35 echo "$NAME."
37 stop)
38 echo -n "Stopping $DESC: "
39 start-stop-daemon --stop --quiet --chuid tango:tango --pidfile /var/run/$NAME.pid \
40 --exec $DAEMON --oknodo
41 echo "$NAME."
43 #reload)
45 # If the daemon can reload its config files on the fly
46 # for example by sending it SIGHUP, do it here.
48 # If the daemon responds to changes in its config file
49 # directly anyway, make this a do-nothing entry.
51 # echo "Reloading $DESC configuration files."
52 # start-stop-daemon --stop --signal 1 --quiet --pidfile \
53 # /var/run/$NAME.pid --exec $DAEMON
54 #;;
55 force-reload)
57 # If the "reload" option is implemented, move the "force-reload"
58 # option to the "reload" entry above. If not, "force-reload" is
59 # just the same as "restart" except that it does nothing if the
60 # daemon isn't already running.
61 # check wether $DAEMON is running. If so, restart
62 start-stop-daemon --stop --test --quiet --pidfile \
63 /var/run/$NAME.pid --exec $DAEMON \
64 && $0 restart \
65 || exit 0
67 restart)
68 echo -n "Restarting $DESC: "
69 start-stop-daemon --stop --quiet --pidfile \
70 /var/run/$NAME.pid --exec $DAEMON
71 sleep 1
72 start-stop-daemon --start --quiet --make-pidfile --background --pidfile \
73 /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
74 echo "$NAME."
77 N=/etc/init.d/$NAME
78 # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
79 echo "Usage: $N {start|stop|restart|force-reload}" >&2
80 exit 1
82 esac
84 exit 0