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
9 . /etc/init.d/functions
11 [ -n "$UTIL_VSERVER_VARS" ] || UTIL_VSERVER_VARS=/usr/lib/util-vserver/util-vserver-vars
12 if [ ! -e "$UTIL_VSERVER_VARS" ] ; then
13 echo "Can not find util-vserver installation (the file '$UTIL_VSERVER_VARS' would be expected); aborting..." >&2
16 . "$UTIL_VSERVER_VARS"
18 # See how we were called.
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"
41 if [ -f /var/lock/subsys/rebootmgr ] ; then
42 show "Stopping the legacy vserver reboot manager"
44 kill `cat /var/run/rebootmgr.pid`
45 rm -f /var/lock/subsys/rebootmgr
46 rm -f /var/run/rebootmgr.pid
49 msg_not_running "legacy vserver reboot manager"
57 if [ -f /var/run/rebootmgr.pid ] ; then
58 if kill -0 `cat /var/run/rebootmgr.pid` ; then
59 echo rebootmgr is running
61 echo rebootmgr is NOT running
66 echo "Usage: $0 {start|stop|restart|status}"
72 # This must be last line !
73 # vi:syntax=sh:tw=78:ts=8:sw=4