blob: 5d2375b4e9341add77d7aa9da8d9bdc335352a7c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
#!/sbin/runscript
## description: The rebootmgr service is monitoring all virtual servers \
## and restart them as need. Virtual servers are using \
## the /sbin/vreboot command to talk with the reboot manager
##
## TODO: replace "echo" by "estart", add "eend", use "start-stop-daemon", ...
DEFAULT_VSERVERDIR=/vservers
USR_SBIN=/usr/sbin
PIDFILE=/var/run/rebootmgr.pid
start() {
echo "Starting the reboot manager"
cd /etc/vservers
VSERVERS=
for serv in *.conf
do
test -f "$serv" || continue
serv=`basename $serv .conf`
if [ -d $DEFAULT_VSERVERDIR/$serv ] ; then
VSERVERS="$VSERVERS $serv"
fi
done
$USR_SBIN/rebootmgr --pidfile $PIDFILE $VSERVERS &
}
stop() {
echo "Stopping the reboot manager"
kill `cat $PIDFILE`
rm -f $PIDFILE
}
## TODO: do we want this?
my_status() {
if [ -f $PIDFILE ] ; then
if kill -0 `cat $PIDFILE`
then
echo rebootmgr is running
else
echo rebootmgr is NOT running
fi
fi
}
|