~ubuntu-branches/ubuntu/jaunty/trousers/jaunty

« back to all changes in this revision

Viewing changes to debian/trousers.init

  • Committer: Bazaar Package Importer
  • Author(s): William Lima
  • Date: 2007-06-04 11:20:17 UTC
  • Revision ID: james.westby@ubuntu.com-20070604112017-imc97jfa6vm15cac
Tags: 0.2.9.1-0ubuntu2
 * Beautify debian/rules.
 * Switch to dpatch.
 * Enable GTK GUI popup functionality.
 * Add "friendly name" for group.
 * Add debian/watch.
 * Add XS-Vcs-Bzr debian/control field.
 * Add an option to disable trousers init script.
 * Fix a loop bug on trousers init script.
 * Add udev rules for TPM devices.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
[ -x $DAEMON ] || exit 0
22
22
 
23
 
MODULE_OPTS=
24
 
TPM_MODULES=
25
23
[ -f $DEFAULTFILE ] && . $DEFAULTFILE
26
24
 
27
25
. /lib/lsb/init-functions
28
26
. /etc/default/rcS
29
27
 
 
28
case "$TROUSERS_ENABLE" in
 
29
  [Nn]*)
 
30
    log_warning_msg "To enable $NAME, edit $DEFAULTFILE and set TROUSERS_ENABLE=yes"
 
31
    exit 0
 
32
    ;;
 
33
esac
 
34
 
30
35
load_modules() {
31
36
        if [ -n "${TPM_MODULES}" ]; then
32
37
            for d in ${TPM_MODULES}; do
33
38
                if echo `/sbin/lsmod` | grep -q -w "$d"; then
34
39
                    [ "$VERBOSE" != no ] && log_success_msg "Module already loaded: $d"
 
40
                    continue
35
41
                else
36
42
                    if modprobe -q $d $MODULE_OPTS 2>/dev/null; then
37
43
                        [ "$VERBOSE" != no ] && log_success_msg "Loaded module: $d"
 
44
                        continue
38
45
                    else
39
46
                        if [ "$VERBOSE" != no ]; then
40
47
                            log_warning_msg "Unable to load module: $d"
 
48
                            continue
41
49
                        fi
42
50
                    fi
43
51
                fi
56
64
        load_modules
57
65
        check_modules
58
66
        log_daemon_msg "Starting $DESC" "$NAME"
59
 
        start-stop-daemon --start --quiet --chuid tss --exec $DAEMON
 
67
        start-stop-daemon --start --quiet --chuid tpm --exec $DAEMON
60
68
        log_end_msg $?
61
69
}
62
70
 
63
71
tcsd_stop() {
64
72
        log_daemon_msg "Stopping $DESC" "$NAME"
65
 
        start-stop-daemon --stop --quiet --oknodo --exec $DAEMON --user tss
 
73
        start-stop-daemon --stop --quiet --oknodo --exec $DAEMON --user tpm
66
74
        log_end_msg $?
67
75
}
68
76