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"
20 # See how we were called.
23 if [ ! -f /var/lock/subsys/rebootmgr ] ; then
24 show "Starting the legacy vserver reboot manager"
28 for serv in *.conf; do
29 [ -f "$serv" ] || continue
30 serv=`basename $serv .conf`
31 if [ -d $__DEFAULT_VSERVERDIR/$serv ] ; then
32 VSERVERS="$VSERVERS $serv"
35 $_REBOOTMGR --pidfile /var/run/rebootmgr.pid $VSERVERS &
36 touch /var/lock/subsys/rebootmgr
39 msg_already_running "legacy vserver reboot manager"
43 if [ -f /var/lock/subsys/rebootmgr ] ; then
44 show "Stopping the legacy vserver reboot manager"
46 kill $(cat /var/run/rebootmgr.pid)
47 rm -f /var/lock/subsys/rebootmgr
48 rm -f /var/run/rebootmgr.pid
51 msg_not_running "legacy vserver reboot manager"
59 if [ -f /var/run/rebootmgr.pid ] ; then
60 if kill -0 $(cat /var/run/rebootmgr.pid); then
61 echo rebootmgr is running
63 echo rebootmgr is NOT running
68 msg_usage "$0 {start|stop|restart|status}"