~upstart-devel/upstart/upstart-jobs

« back to all changes in this revision

Viewing changes to sid/etc/init.d/irkerhook-lxc

  • Committer: Dimitri John Ledkov
  • Date: 2014-11-19 14:08:18 UTC
  • Revision ID: dimitri.j.ledkov@intel.com-20141119140818-xlb2v9ahs1h2e5tq
update

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
 
3
 
### BEGIN INIT INFO
4
 
# Provides:             irkerhook-lxc
5
 
# Required-Start:       $remote_fs
6
 
# Required-Stop:        $remote_fs
7
 
# Should-Start:         irker
8
 
# Should-Stop:          irker
9
 
# Default-Start:        2 3 4 5
10
 
# Default-Stop:         0 6
11
 
# Short-Description:    irkerhook-lxc
12
 
# Description:          irkerhook-lxc
13
 
# X-Start-Before:       lxc
14
 
# X-Stop-After:
15
 
# X-Interactive:        true
16
 
### END INIT INFO
17
 
 
18
 
 
19
 
set -e
20
 
 
21
 
if [ ! -x /usr/bin/irkerhook-lxc ] || [ ! -x /usr/bin/irkerd ]
22
 
then
23
 
        exit 0
24
 
fi
25
 
 
26
 
for _FILE in /etc/default/irkerhook-lxc /etc/default/irkerhook-lxc.d/*
27
 
do
28
 
        if [ -f "${_FILE}" ]
29
 
        then
30
 
                . "${_FILE}" || true
31
 
        fi
32
 
done
33
 
 
34
 
if [ "${IRK_ENABLED}" != "true" ]
35
 
then
36
 
        exit 0
37
 
fi
38
 
 
39
 
. /lib/lsb/init-functions
40
 
 
41
 
case "${1}" in
42
 
        start)
43
 
                log_daemon_msg "Starting irkerhook-lxc"
44
 
                sleep 1
45
 
 
46
 
                _KERNEL="$(uname -r)"
47
 
                irkerhook-lxc "\x0312$(hostname -f):\x03 host system \x0303started\x03 (linux ${_KERNEL})"
48
 
                ;;
49
 
 
50
 
        stop)
51
 
                log_daemon_msg "Stopping irkerhook-lxc"
52
 
 
53
 
                _UPTIME="$(uptime | sed -e 's|.*up ||' -e 's|,.*||')"
54
 
                irkerhook-lxc "\x0312$(hostname -f):\x03 host system \x0304stopped\x03 (uptime ${_UPTIME})"
55
 
                ;;
56
 
 
57
 
        restart|force-reload)
58
 
 
59
 
                ;;
60
 
 
61
 
        *)
62
 
                log_success_msg "Usage: ${0} {start|stop}"
63
 
                exit 1
64
 
                ;;
65
 
esac
66
 
 
67
 
exit 0