~ahasenack/landscape-client/landscape-client-1.5.5-0ubuntu0.9.04.0

« back to all changes in this revision

Viewing changes to debian/landscape-client.init

  • Committer: Bazaar Package Importer
  • Author(s): Rick Clark
  • Date: 2008-09-08 16:35:57 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080908163557-l3ixzj5dxz37wnw2
Tags: 1.0.18-0ubuntu1
New upstream release 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
### BEGIN INIT INFO
 
4
# Provides: landscape-client
 
5
# Required-Start: $local_fs $remote_fs hal dbus
 
6
# Required-Stop: $local_fs $remote_fs hal dbus
 
7
# Default-Start: 2 3 4 5
 
8
# Default-Stop: 0 1 6
 
9
# Short-Description: Landscape client daemons
 
10
# Description: The Landscape client daemons are needed so the
 
11
#              Landscape server can manage a computer.
 
12
### END INIT INFO
 
13
 
 
14
LANDSCAPE_DEFAULTS=/etc/default/landscape-client
 
15
NAME=landscape-client
 
16
DAEMON=/usr/bin/$NAME
 
17
PIDFILE=/var/run/$NAME.pid
 
18
RUN=0 # overridden in /etc/default/landscape-client
 
19
 
 
20
[ -f $DAEMON ] || exit 0
 
21
 
 
22
. /lib/lsb/init-functions
 
23
[ -f $LANDSCAPE_DEFAULTS ] && . $LANDSCAPE_DEFAULTS
 
24
 
 
25
if [ $RUN -eq 0 ]; then
 
26
        echo "$NAME is not configured, please run landscape-config."
 
27
        exit 0
 
28
fi
 
29
 
 
30
case "$1" in
 
31
        start)
 
32
                log_daemon_msg "Starting the $NAME daemon"
 
33
                start-stop-daemon --start --quiet --oknodo --exec $DAEMON -- --daemon --pid-file $PIDFILE
 
34
                log_end_msg $?
 
35
                ;;
 
36
 
 
37
        stop)
 
38
                log_daemon_msg "Stopping $NAME daemon"
 
39
                start-stop-daemon --retry 30 --stop --quiet --pidfile $PIDFILE
 
40
                log_end_msg $?
 
41
                ;;
 
42
 
 
43
        status)
 
44
                # We want to maintain backward compatibility with Dapper,
 
45
                # so we're not going to use status_of_proc()
 
46
                pidofproc -p $PIDFILE $DAEMON >/dev/null
 
47
                status=$?
 
48
                if [ $status -eq 0 ]; then
 
49
                        log_success_msg "$NAME is running"
 
50
                else
 
51
                        log_failure_msg "$NAME is not running"
 
52
                fi
 
53
                exit $status
 
54
                ;;
 
55
 
 
56
        restart|force-reload)
 
57
                $0 stop && $0 start
 
58
                ;;
 
59
 
 
60
        *)
 
61
                echo "Usage: $0 {start|stop|status|restart|force-reload}"
 
62
                exit 1
 
63
                ;;
 
64
esac
 
65
 
 
66
exit 0