X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=host.init;h=f207e008a525ab98501024070e0b4c4dafd31e21;hb=55a2e99670646aa2dcb2c3d3ca496ef94a4585ba;hp=79920a0bc047d3332be204aa42c975c4977e5d97;hpb=b9692ec3348a5f98af60f3dbc423e298ea00123d;p=myplc.git 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