From: Mark Huang Date: Mon, 17 Jul 2006 21:30:33 +0000 (+0000) Subject: - support being called as either /etc/init.d/plc or /etc/init.d/plc-devel X-Git-Tag: planetlab-4_0-rc1~140 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;ds=sidebyside;h=89d82e004b53b03da4d2a73d7f9982333711b6ff;p=myplc.git - support being called as either /etc/init.d/plc or /etc/init.d/plc-devel - pass "reload" onto guest plc initscript --- diff --git a/host.init b/host.init index 79920a0..f207e00 100755 --- a/host.init +++ b/host.init @@ -6,7 +6,7 @@ # # description: Manages all PLC services on this machine # -# $Id: host.init,v 1.7 2006/05/23 18:00:21 mlhuang Exp $ +# $Id: host.init,v 1.8 2006/07/06 17:43:52 mlhuang Exp $ # PATH=/sbin:/bin:/usr/bin:/usr/sbin @@ -29,8 +29,12 @@ if ! type -type success >/dev/null || ! type -type failure >/dev/null ; then fi # Source configuration -if [ -f /etc/sysconfig/plc -a -z "${PLC_ROOT}${PLC_DATA}" ] ; then - . /etc/sysconfig/plc +SERVICE=$(basename $0) +if [ ! -f /etc/sysconfig/$SERVICE ] ; then + SERVICE=plc +fi +if [ -f /etc/sysconfig/$SERVICE -a -z "${PLC_ROOT}${PLC_DATA}" ] ; then + . /etc/sysconfig/$SERVICE fi # Total number of errors @@ -141,12 +145,16 @@ case "$command" in start $* ;; + reload) + chroot $PLC_ROOT /sbin/service plc $PLC_OPTIONS reload $* + ;; + mount|umount|mountstatus) ${command}_plc $* ;; *) - echo "Usage: $0 {start|stop|restart|mount|umount|mountstatus}" + echo "Usage: $0 {start|stop|restart|reload|mount|umount|mountstatus}" RETVAL=1 ;; esac