3 # vzeventd This shell script takes care of starting and stopping
4 # vzeventd daemon for OpenVZ.
6 # chkconfig: 2345 95 89
7 # description: vzeventd is OpenVZ events daemon. \
8 # It takes care of events sent by the OpenVZ kernel and performs required \
9 # actions associated with those events.
13 # Required-start: $remote_fs
14 # Required-stop: $remote_fs
15 # Default-Start: 2 3 4 5
19 # Short-Description: start and stop vzeventd
20 # Description: vzeventd is the OpenVZ events daemon.
21 # It takes care of events sent by the OpenVZ kernel
22 # and performs required actions associated with those events.
25 . @VZLIBDIR@/initd-functions
28 lockfile=$VARLOCK/$prog
31 modprobe vzevent reboot_event=1
35 local param=/sys/module/vzevent/parameters/reboot_event
37 show "Checking vzevent kernel module"
39 if ! lsmod | fgrep -qw vzevent; then
43 if ! cat $param | fgrep -qw 1; then
45 print_warning "vzevent module should be loaded with reboot_event=1 parameter"
53 [ "$EUID" != "0" ] && exit 4
54 [ -x @SBINDIR@/vzeventd ] || exit 5
55 [ -r /etc/sysconfig/vzeventd ] && . /etc/sysconfig/vzeventd
56 [ -r /etc/default/vzeventd ] && . /etc/default/vzeventd
58 [ -f $lockfile ] && exit 0 # Already running
64 vzdaemon_start $prog $OPTIONS
66 [ $RETVAL -eq 0 ] && touch $lockfile
71 [ "$EUID" != "0" ] && exit 4
75 [ $RETVAL -eq 0 ] && rm -f $lockfile
79 # See how we were called.
94 try-restart|condrestart)
95 if vzdaemon_status $prog >/dev/null 2>&1; then
104 echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}"