[sheepdog] [PATCH] Various init script fixups

Jason Noble jason.noble at nimboxx.com
Mon May 4 20:22:30 CEST 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Source init-functions on deb-based distros to provide killproc.

Use SHEEPDOGD variable in init script

SHEEPDOGD is defined but is not used when starting sheep. This change
allows system default configs to override SHEEPDOGD if desired.

Use SHEEPDOG_PATH in init script

The debian defaults file has a comment that this environment variable
is used by the init script to set the sheepdog storage dir, however
the code in the init script does not support this claim. This change
makes the needed changes that allow this to work.
- ---
 script/sheepdog.in | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/script/sheepdog.in b/script/sheepdog.in
index bb38eea..7975cb2 100755
- --- a/script/sheepdog.in
+++ b/script/sheepdog.in
@@ -18,7 +18,8 @@ prog="sheep"

 # set secure PATH
 PATH="/sbin:/bin:/usr/sbin:/usr/bin:@SBINDIR@"
- -SHEEPDOGD=@SBINDIR@/sheep
+SHEEPDOGD=@SBINDIR@/$prog
+SHEEPDOG_PATH=@LOCALSTATEDIR@/lib/sheepdog

 success()
 {
@@ -51,6 +52,7 @@ fi

 # deb based distros
 if [ -d @SYSCONFDIR@/default ]; then
+	[ -s @LIBDIR@/lsb/init-functions ] && . @LIBDIR@/lsb/init-functions
 	[ -f @SYSCONFDIR@/default/$prog ] && . @SYSCONFDIR@/default/$prog
 	[ -z "$LOCK_FILE" ] && LOCK_FILE="@LOCALSTATEDIR@/lock/$prog"
 fi
@@ -84,7 +86,7 @@ start()
 	if status $prog > /dev/null 2>&1; then
 		success
 	else
- -		$prog -p 7000 @LOCALSTATEDIR@/lib/sheepdog > /dev/null 2>&1
+		$SHEEPDOGD -p 7000 $SHEEPDOG_PATH > /dev/null 2>&1

 		# give it time to fail
 		sleep 2
- --
1.9.1

Jason Noble | Software Architect
NIMBOXX, Inc.
10535 Boyer Blvd. #200
Austin, TX 78758
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.22 (Darwin)
Comment: GPGTools - http://gpgtools.org

iQEcBAEBAgAGBQJVR7jmAAoJEOZ9DbcrzpDOpJEH/jms+Br5naTvLYxwe4bf6e5+
Iy2nzRz+dTFYC0SzQZh/ObEOeLKRiIpJ/wHvtkrav0tf2QYzUDBlp/mT/sUAUM6F
XMO6z9RciDzOUZVEHJiBGd+wlL/lK7cSwkEVT3xUrJXs0vSXu0gd0f52oh+aZuuh
JLJPNjaOMMxzKb9pO+DcVo3B1n3SfZMJUTZ+J76+y8RH1dELkoAnzm7hS4N4U17b
XC0qREF/4HxzVcQZwlNWjR2YSmdRaWdnn75l6z7IezTP3//hXiOmsQByiXiCtfMl
X/gbDcuIhPni5LhR6myB+nKNDb4+U1gnmaZ4pN89swxGXzwFS8ceA9dtPpmNisg=
=zbhG
-----END PGP SIGNATURE-----



More information about the sheepdog mailing list