From: Thierry Parmentelat Date: Tue, 18 Apr 2006 15:39:35 +0000 (+0000) Subject: supports for separate mount/umount/mountstatus operations X-Git-Tag: myplc-0_4-rc1~61 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=563cb37d54fc638bc793946c03e192729ca921ab;p=myplc.git supports for separate mount/umount/mountstatus operations --- diff --git a/host.init b/host.init index 5c22f9c..77cd087 100755 --- a/host.init +++ b/host.init @@ -6,7 +6,7 @@ # # description: Manages all PLC services on this machine # -# $Id: host.init,v 1.3 2006/04/07 17:12:52 mlhuang Exp $ +# $Id: host.init,v 1.4 2006/04/12 19:30:47 mlhuang Exp $ # PATH=/sbin:/bin:/usr/bin:/usr/sbin @@ -37,7 +37,7 @@ mounted () fi } -start () +mount_plc () { echo -n $"Mounting PLC: " @@ -64,13 +64,8 @@ start () check } -stop () +umount_plc () { - if mounted $PLC_ROOT ; then - chroot $PLC_ROOT /sbin/service plc $PLC_OPTIONS stop $* - check - fi - echo -n $"Unmounting PLC: " for dir in $PLC_ROOT/proc $PLC_ROOT/data $PLC_ROOT ; do @@ -84,6 +79,28 @@ stop () echo } +stop () +{ + if mounted $PLC_ROOT ; then + chroot $PLC_ROOT /sbin/service plc $PLC_OPTIONS stop $* + check + fi + + umount_plc + +} + +mount_status () +{ + lines=$(mount | grep $PLC_ROOT) + if [ -z "$lines" ] ; then + echo "==== $PLC_ROOT is *not* mounted" + else + echo "==== The following mount points remain active" + echo "$lines" + fi +} + # Get command shift $(($OPTIND - 1)) command=$1 @@ -101,6 +118,14 @@ case "$command" in start $* ;; + mount|umount) + ${command}_plc $* + ;; + + mountstatus) + mount_status $* + ;; + *) echo "Usage: $0 {start|stop|restart}" RETVAL=1