From 6a7e6ba667861d81b50fc64e164f671e5c8a1aa3 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Sat, 11 Feb 2012 17:37:10 +0100 Subject: [PATCH] get SLICE and ZSLICE from group name --- init.d/_start_stop | 6 ++++++ init.d/s1-transmission | 1 - init.d/s1-zfs | 2 -- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/init.d/_start_stop b/init.d/_start_stop index 009eaed..c712d4d 100755 --- a/init.d/_start_stop +++ b/init.d/_start_stop @@ -1,5 +1,11 @@ +# by default, detach from terminal 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=`grep $SLICE_GROUP /var/lib/extrausers/group | cut -d: -f2` +export ZSLICE=`echo $SLICE | sed 's;^;;'` _start_stop() { diff --git a/init.d/s1-transmission b/init.d/s1-transmission index 903de7f..b0b0398 100755 --- a/init.d/s1-transmission +++ b/init.d/s1-transmission @@ -1,6 +1,5 @@ #!/bin/sh -export ZSLICE=rsync1/s1 DAEMON="./gearman/transmission.pl" . /srv/cloudstore/init.d/_start_stop diff --git a/init.d/s1-zfs b/init.d/s1-zfs index ecb4164..890c190 100755 --- a/init.d/s1-zfs +++ b/init.d/s1-zfs @@ -2,8 +2,6 @@ DAEMON="./gearman/zfs.pl" -export ZSLICE=rsync1/s1 - . /srv/cloudstore/init.d/_start_stop _start_stop $* -- 2.20.1