From: Elan Ruusamäe Date: Tue, 29 Apr 2008 20:43:37 +0000 (+0000) Subject: - cosmetics X-Git-Tag: auto/th/util-vserver-0_30_215-4~5 X-Git-Url: http://git.pld-linux.org/?p=packages%2Futil-vserver.git;a=commitdiff_plain;h=5e118b6e990f17959d77cddedfe250c148052c37 - cosmetics Changed files: rebootmgr.init -> 1.3 vprocunhide.init -> 1.11 vrootdevices.init -> 1.5 vservers-legacy.init -> 1.3 --- diff --git a/rebootmgr.init b/rebootmgr.init index 5dd2143..cae15c6 100644 --- a/rebootmgr.init +++ b/rebootmgr.init @@ -5,6 +5,8 @@ # the /sbin/vreboot command to talk with the reboot manager # processname: rebootmgr # config: /etc/vservers +# +# $Id$ . /etc/init.d/functions @@ -17,18 +19,18 @@ fi # 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 @@ -37,37 +39,34 @@ case "$1" in 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 diff --git a/vprocunhide.init b/vprocunhide.init index f4462b8..317f6c6 100644 --- a/vprocunhide.init +++ b/vprocunhide.init @@ -4,6 +4,8 @@ # # chkconfig: 2345 26 74 # description: Makes some /proc entries visibly for vservers +# +# $Id$ # if kernel not capable, exit early if [ ! -d /proc/virtual ]; then @@ -49,20 +51,20 @@ stop() { } 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 ;; diff --git a/vrootdevices.init b/vrootdevices.init index 3e85bc9..8e274ab 100644 --- a/vrootdevices.init +++ b/vrootdevices.init @@ -4,6 +4,8 @@ # # chkconfig: 345 97 03 # description: Setup vroot devices for use inside vservers +# +# $Id$ # Source function library . /etc/rc.d/init.d/functions @@ -71,13 +73,13 @@ case "$1" in 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 diff --git a/vservers-legacy.init b/vservers-legacy.init index d720209..282767d 100644 --- a/vservers-legacy.init +++ b/vservers-legacy.init @@ -2,6 +2,8 @@ # chkconfig: 345 98 02 # description: The vservers service is used to start and stop all # the virtual servers. +# +# $Id$ . /etc/init.d/functions @@ -18,8 +20,7 @@ fi sortserver(){ ( cd $__CONFDIR - for serv in *.conf - do + for serv in *.conf; do test -f "$serv" || continue PRIORITY=100 @@ -32,8 +33,7 @@ sortserver(){ startservers(){ cd $__CONFDIR - for name in `sortserver` - do + for name in $(sortserver); do ONBOOT= . $name.conf if [ "$ONBOOT" = "yes" ] ; then @@ -49,9 +49,9 @@ case "$1" in show "Starting the virtual servers" busy if [ "$BACKGROUND" = "yes" ] ; then - startservers >/dev/tty8 /dev/tty8 & + startservers >/dev/tty8 /dev/tty8 & else - startservers + startservers fi touch /var/lock/subsys/vservers-legacy ok @@ -64,8 +64,8 @@ case "$1" in 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 @@ -78,25 +78,22 @@ case "$1" in $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