4
# Required-Start: $local_fs $network
5
# Required-Start: $local_fs
6
# Required-Stop: $local_fs
8
# Default-Start: 2 3 4 5
9
# Default-Stop: S 0 1 6
10
# Short-Description: Start or stop TrouSerS tcsd daemon.
9
# Default-Start: 2 3 4 5
11
# Short-Description: starts tcsd
12
# Description: tcsd belongs to the TrouSerS TCG Software Stack
15
PATH=/sbin:/bin:/usr/sbin:/usr/bin
18
DESC="Trusted Computing daemon"
20
test -x $DAEMON || exit 0
16
DESC="TrouSerS TCS daemon"
19
DEFAULTFILE=/etc/default/trousers
21
[ -x $DAEMON ] || exit 0
23
[ -f $DEFAULTFILE ] && . $DEFAULTFILE
25
. /lib/lsb/init-functions
28
case "$TROUSERS_ENABLE" in
30
log_warning_msg "To enable $NAME, edit $DEFAULTFILE and set TROUSERS_ENABLE=yes"
36
if [ -n "${TPM_MODULES}" ]; then
37
for d in ${TPM_MODULES}; do
38
if echo `/sbin/lsmod` | grep -q -w "$d"; then
39
[ "$VERBOSE" != no ] && log_success_msg "Module already loaded: $d"
26
echo -n "Starting $DESC: "
29
echo "device driver not loaded, aborting."
33
start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
38
echo -n "Stopping $DESC: "
39
start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid --oknodo --exec $DAEMON
44
echo -n "Restarting $DESC: "
45
start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid --oknodo --exec $DAEMON
49
echo "device driver not loaded, aborting."
52
start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
57
if [ -f /var/run/$NAME.pid ]
59
echo "$NAME is running."
42
if modprobe -q $d $MODULE_OPTS 2>/dev/null; then
43
[ "$VERBOSE" != no ] && log_success_msg "Loaded module: $d"
46
if [ "$VERBOSE" != no ]; then
47
log_warning_msg "Unable to load module: $d"
61
echo "$NAME is not running."
57
if [ ! -c /dev/tpm ] && [ ! -c /dev/tpm0 ]; then
58
log_warning_msg "Not starting $DESC ($NAME); no TPM device found."
66
log_daemon_msg "Starting $DESC" "$NAME"
67
start-stop-daemon --start --quiet --chuid tpm --exec $DAEMON
72
log_daemon_msg "Stopping $DESC" "$NAME"
73
start-stop-daemon --stop --quiet --oknodo --exec $DAEMON --user tpm
84
restart|reload|force-reload)
89
log_success_msg "Usage: $0 {start|stop|restart|reload|force-reload}"
68
echo "Usage: $N {start|stop|restart|force-reload|status}" >&2