3 # description: The rebootmgr service is monitoring all virtual servers \
4 # and restart them as need. Virtual servers are using \
5 # the /sbin/vreboot command to talk with the reboot manager
6 # processname: rebootmgr
7 # config: /etc/vservers
11 . /etc/init.d/functions
13 [ -n "$UTIL_VSERVER_VARS" ] || UTIL_VSERVER_VARS=/usr/lib/util-vserver/util-vserver-vars
14 if [ ! -e "$UTIL_VSERVER_VARS" ] ; then
15 echo "Can not find util-vserver installation (the file '$UTIL_VSERVER_VARS' would be expected); aborting..." >&2
18 . "$UTIL_VSERVER_VARS"
21 if [ ! -f /var/lock/subsys/rebootmgr ] ; then
22 show "Starting the legacy vserver reboot manager"
26 for serv in *.conf; do
27 [ -f "$serv" ] || continue
28 serv=`basename $serv .conf`
29 if [ -d $__DEFAULT_VSERVERDIR/$serv ] ; then
30 VSERVERS="$VSERVERS $serv"
33 $_REBOOTMGR --pidfile /var/run/rebootmgr.pid $VSERVERS &
34 touch /var/lock/subsys/rebootmgr
37 msg_already_running "legacy vserver reboot manager"
42 if [ -f /var/lock/subsys/rebootmgr ] ; then
43 show "Stopping the legacy vserver reboot manager"
45 kill $(cat /var/run/rebootmgr.pid)
46 rm -f /var/lock/subsys/rebootmgr
47 rm -f /var/run/rebootmgr.pid
50 msg_not_running "legacy vserver reboot manager"
55 # See how we were called.
68 if [ -f /var/run/rebootmgr.pid ] ; then
69 if kill -0 $(cat /var/run/rebootmgr.pid); then
70 echo rebootmgr is running
72 echo rebootmgr is NOT running
77 msg_usage "$0 {start|stop|restart|status}"