X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=init.d%2F_start_stop;h=36a37e211d0649924a73debdafd3a3601bfb00ad;hb=3126dc293facee75a183dc2dfb6ee1299b2532fe;hp=c712d4d10dbfd5a6e97e94e3dbb934580ffe3e9f;hpb=6a7e6ba667861d81b50fc64e164f671e5c8a1aa3;p=cloudstore.git diff --git a/init.d/_start_stop b/init.d/_start_stop index c712d4d..36a37e2 100755 --- a/init.d/_start_stop +++ b/init.d/_start_stop @@ -3,9 +3,9 @@ BACKGROUND=1 # deduce name from script name NAME=`basename $0` # generate ZSLICE and SLICE from group name -SLICE_GROUP=`echo $NAME | cut -d\- -f1` +export SLICE_GROUP=`echo $NAME | cut -d\- -f1` export SLICE=`grep $SLICE_GROUP /var/lib/extrausers/group | cut -d: -f2` -export ZSLICE=`echo $SLICE | sed 's;^;;'` +export ZSLICE=`echo $SLICE | sed 's;^/;;'` _start_stop() { @@ -13,16 +13,21 @@ case $1 in start) cd /srv/cloudstore if [ "$BACKGROUND" -eq 1 ] ; then - ( $DAEMON 2>&1 ) >> /tmp/$NAME.log & + ( $DAEMON 2>&1 ) >> $SLICE/log/$NAME.log & echo $! > /tmp/$NAME.pid else $DAEMON fi ;; stop) - kill `cat /tmp/$NAME.pid` ;; + kill `cat /tmp/$NAME.pid` + ;; + restart) + $0 stop + $0 start + ;; *) - echo "usage: $0 {start|stop}" ;; + echo "usage: $0 {start|stop|restart}" ;; esac exit 0