~ubuntu-branches/ubuntu/hardy/trousers/hardy-proposed

« back to all changes in this revision

Viewing changes to debian/trousers.init

  • Committer: Bazaar Package Importer
  • Author(s): Cesare Tirabassi
  • Date: 2008-05-12 22:50:21 UTC
  • Revision ID: james.westby@ubuntu.com-20080512225021-5dgbsbgn4ptpyqat
Tags: 0.3.1-4ubuntu0.1
* Fix the init script failing to properly launch the daemon and therefore
  the package to be installed or removed (LP: #229703):
  - use --make-pidfile to create a pidfile
  - use --background to detach tscd
  - pass -f to tscd to launch tscd in the foreground
  - remove the --oknodo in stop/restart/force-reload
  Thanks to David Smith <dds@google.com> and
  Daniel Baumann <daniel@debian.org> (DBTS #459679)
* Modify Maintainer value to match the DebianMaintainerField
  specification.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
NAME=tcsd
18
18
DESC="Trusted Computing daemon"
19
19
 
20
 
test -x $DAEMON || exit 0
 
20
test -x "${DAEMON}" || exit 0
21
21
 
22
22
set -e
23
23
 
24
24
case "${1}" in
25
25
        start)
26
 
                echo -n "Starting $DESC: "
 
26
                echo -n "Starting ${DESC}: "
27
27
                if [ ! -e /dev/tpm* ]
28
28
                then
29
29
                        echo "device driver not loaded, aborting."
30
30
                        exit 0
31
31
                fi
32
32
 
33
 
                start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
34
 
                echo "$NAME."
 
33
                start-stop-daemon --start --quiet --background --make-pid --pidfile /var/run/${NAME}.pid --exec ${DAEMON} -- -f ${DAEMON_OPTS}
 
34
                echo "${NAME}."
35
35
                ;;
36
36
 
37
37
        stop)
38
 
                echo -n "Stopping $DESC: "
39
 
                start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid --oknodo --exec $DAEMON
40
 
                echo "$NAME."
 
38
                echo -n "Stopping ${DESC}: "
 
39
                start-stop-daemon --stop --quiet --pidfile /var/run/${NAME}.pid --exec ${DAEMON}
 
40
                echo "${NAME}."
41
41
                ;;
42
42
 
43
43
        restart|force-reload)
44
 
                echo -n "Restarting $DESC: "
45
 
                start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid --oknodo --exec $DAEMON
 
44
                "${0}" stop
46
45
                sleep 1
47
 
                if [ ! -e /dev/tpm* ]
48
 
                then
49
 
                        echo "device driver not loaded, aborting."
50
 
                        exit 0
51
 
                fi
52
 
                start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
53
 
                echo "$NAME."
 
46
                "${0}" start
54
47
                ;;
55
48
 
56
49
        status)
57
 
                if [ -f /var/run/$NAME.pid ]
 
50
                if [ -f /var/run/${NAME}.pid ]
58
51
                then
59
 
                        echo "$NAME is running."
 
52
                        echo "${NAME} is running."
60
53
                else
61
 
                        echo "$NAME is not running."
 
54
                        echo "${NAME} is not running."
62
55
                        exit 1
63
56
                fi
64
57
                ;;
65
58
 
66
59
        *)
67
 
                N=/etc/init.d/$NAME
68
 
                echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
 
60
                echo "Usage: ${NAME} {start|stop|restart|force-reload|status}" >&2
69
61
                exit 1
70
62
                ;;
71
63
esac