# the /sbin/vreboot command to talk with the reboot manager
# processname: rebootmgr
# config: /etc/vservers
+#
+# $Id$
. /etc/init.d/functions
# See how we were called.
case "$1" in
- start)
- if [ ! -f /var/lock/subsys/rebootmgr ] ; then
+ start)
+ if [ ! -f /var/lock/subsys/rebootmgr ] ; then
show "Starting the legacy vserver reboot manager"
busy
cd $__CONFDIR
VSERVERS=
- for serv in *.conf ; do
- [ -f "$serv" ] || continue
- serv=`basename $serv .conf`
- if [ -d $__DEFAULT_VSERVERDIR/$serv ] ; then
- VSERVERS="$VSERVERS $serv"
- fi
+ for serv in *.conf; do
+ [ -f "$serv" ] || continue
+ serv=`basename $serv .conf`
+ if [ -d $__DEFAULT_VSERVERDIR/$serv ] ; then
+ VSERVERS="$VSERVERS $serv"
+ fi
done
$_REBOOTMGR --pidfile /var/run/rebootmgr.pid $VSERVERS &
touch /var/lock/subsys/rebootmgr
msg_already_running "legacy vserver reboot manager"
fi
;;
- stop)
- if [ -f /var/lock/subsys/rebootmgr ] ; then
- show "Stopping the legacy vserver reboot manager"
- busy
- kill `cat /var/run/rebootmgr.pid`
- rm -f /var/lock/subsys/rebootmgr
- rm -f /var/run/rebootmgr.pid
- ok
+ stop)
+ if [ -f /var/lock/subsys/rebootmgr ] ; then
+ show "Stopping the legacy vserver reboot manager"
+ busy
+ kill $(cat /var/run/rebootmgr.pid)
+ rm -f /var/lock/subsys/rebootmgr
+ rm -f /var/run/rebootmgr.pid
+ ok
else
msg_not_running "legacy vserver reboot manager"
fi
;;
- restart)
- $0 stop
+ restart)
+ $0 stop
$0 start
;;
- status)
- if [ -f /var/run/rebootmgr.pid ] ; then
- if kill -0 `cat /var/run/rebootmgr.pid` ; then
- echo rebootmgr is running
+ status)
+ if [ -f /var/run/rebootmgr.pid ] ; then
+ if kill -0 $(cat /var/run/rebootmgr.pid); then
+ echo rebootmgr is running
else
- echo rebootmgr is NOT running
+ echo rebootmgr is NOT running
fi
fi
;;
- *)
- echo "Usage: $0 {start|stop|restart|status}"
- exit 1
+ *)
+ msg_usage "$0 {start|stop|restart|status}"
+ exit 3
esac
exit 0
-
-# This must be last line !
-# vi:syntax=sh:tw=78:ts=8:sw=4
#
# chkconfig: 2345 26 74
# description: Makes some /proc entries visibly for vservers
+#
+# $Id$
# if kernel not capable, exit early
if [ ! -d /proc/virtual ]; then
}
case "$1" in
-start|restart|reload)
+ start|restart|reload)
start
;;
-stop)
+ stop)
stop
;;
-status)
- if [ -f /var/lock/subsys/vprocunhide ] ; then
+ status)
+ if [ -f /var/lock/subsys/vprocunhide ]; then
echo "vservers /proc entries were fixed"
else
echo "vservers /proc entries were not fixed"
fi
;;
-*)
+ *)
msg_usage "$0 {start|stop|reload|restart|status}"
exit 3
;;
#
# chkconfig: 345 97 03
# description: Setup vroot devices for use inside vservers
+#
+# $Id$
# Source function library
. /etc/rc.d/init.d/functions
stop)
stop
;;
- status)
- echo "There is no way to tell"
- ;;
restart|force-reload)
stop
start
;;
+ status)
+ echo "There is no way to tell"
+ ;;
*)
msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
exit 3
# chkconfig: 345 98 02
# description: The vservers service is used to start and stop all
# the virtual servers.
+#
+# $Id$
. /etc/init.d/functions
sortserver(){
(
cd $__CONFDIR
- for serv in *.conf
- do
+ for serv in *.conf; do
test -f "$serv" || continue
PRIORITY=100
startservers(){
cd $__CONFDIR
- for name in `sortserver`
- do
+ for name in $(sortserver); do
ONBOOT=
. $name.conf
if [ "$ONBOOT" = "yes" ] ; then
show "Starting the virtual servers"
busy
if [ "$BACKGROUND" = "yes" ] ; then
- startservers >/dev/tty8 </dev/tty8 2>/dev/tty8 &
+ startservers >/dev/tty8 </dev/tty8 2>/dev/tty8 &
else
- startservers
+ startservers
fi
touch /var/lock/subsys/vservers-legacy
ok
show "Stopping the virtual servers"
busy
cd $__CONFDIR
- for name in `sortserver -r` ; do
- $_VSERVER_LEGACY $name stop
+ for name in $(sortserver -r); do
+ $_VSERVER_LEGACY $name stop
done
rm -f /var/lock/subsys/vservers-legacy
ok
$0 start
;;
status)
- if [ -f /var/lock/subsys/vservers-legacy ] ; then
+ if [ -f /var/lock/subsys/vservers-legacy ]; then
cd $__CONFDIR
- for serv in *.conf ; do
- ONBOOT=no
- name=`basename $serv .conf`
- . $serv
- echo -n ONBOOT=$ONBOOT " "
- $_VSERVER_LEGACY $name running
+ for serv in *.conf; do
+ ONBOOT=no
+ name=$(basename $serv .conf)
+ . $serv
+ echo -n ONBOOT=$ONBOOT " "
+ $_VSERVER_LEGACY $name running
done
else
msg_not_running "virtual servers"
fi
;;
*)
- echo "Usage: vservers {start|stop|restart|status}"
- exit 1
+ msg_usage "$0 {start|stop|restart|status}"
+ exit 3
esac
exit $RETVAL
-
-# This must be last line !
-# vi:syntax=sh:tw=78:ts=8:sw=4