zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ph...@apache.org
Subject svn commit: r1302069 - in /zookeeper/trunk: CHANGES.txt src/packages/deb/init.d/zookeeper
Date Sun, 18 Mar 2012 06:49:03 GMT
Author: phunt
Date: Sun Mar 18 06:49:02 2012
New Revision: 1302069

URL: http://svn.apache.org/viewvc?rev=1302069&view=rev
Log:
ZOOKEEPER-1406. dpkg init scripts don't restart - missing check_priv_sep_dir (Chris Beauchamp
via phunt)

Modified:
    zookeeper/trunk/CHANGES.txt
    zookeeper/trunk/src/packages/deb/init.d/zookeeper

Modified: zookeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/trunk/CHANGES.txt?rev=1302069&r1=1302068&r2=1302069&view=diff
==============================================================================
--- zookeeper/trunk/CHANGES.txt (original)
+++ zookeeper/trunk/CHANGES.txt Sun Mar 18 06:49:02 2012
@@ -153,6 +153,9 @@ BUGFIXES:
   thrown from setACL command through client (Kavita Sharma via phunt)
  
   ZOOKEEPER-1390. some expensive debug code not protected by a check for debug (breed via
camille)
+
+  ZOOKEEPER-1406. dpkg init scripts don't restart - missing
+  check_priv_sep_dir (Chris Beauchamp via phunt)
    
 IMPROVEMENTS:
 

Modified: zookeeper/trunk/src/packages/deb/init.d/zookeeper
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/packages/deb/init.d/zookeeper?rev=1302069&r1=1302068&r2=1302069&view=diff
==============================================================================
--- zookeeper/trunk/src/packages/deb/init.d/zookeeper (original)
+++ zookeeper/trunk/src/packages/deb/init.d/zookeeper Sun Mar 18 06:49:02 2012
@@ -34,7 +34,17 @@ umask 022
 
 . /lib/lsb/init-functions
 
-ZOOPIDFILE=/var/lib/zookeeper/data/zookeeper_server.pid
+ZOOPIDDIR=/var/lib/zookeeper/data
+ZOOPIDFILE=${ZOOPIDDIR}/zookeeper_server.pid
+
+check_privsep_dir() {
+    # Create the PrivSep empty dir if necessary
+    if [ ! -d ${ZOOPIDDIR} ]; then
+	mkdir -p ${ZOOPIDDIR}
+        chown zookeeper:hadoop ${ZOOPIDDIR}
+	chmod 0775 ${ZOOPIDDIR} 
+    fi
+}
 
 # Are we running from init?
 run_by_init() {
@@ -59,6 +69,7 @@ export PATH="${PATH:+$PATH:}/usr/sbin:/u
 case "$1" in
   start)
 	check_for_no_start
+	check_privsep_dir
 	log_daemon_msg "Starting Apache ZooKeeper server" "zookeeper"
 	if start-stop-daemon --start --quiet --oknodo --pidfile ${ZOOPIDFILE} -c zookeeper -x ${ZOOKEEPER_PREFIX}/sbin/zkServer.sh
start; then
 	    log_end_msg 0
@@ -80,7 +91,7 @@ case "$1" in
 	log_daemon_msg "Restarting Apache ZooKeeper server" "zookeeper"
 	start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile ${ZOOPIDFILE}
 	check_for_no_start log_end_msg
-	if start-stop-daemon --start --quiet --oknodo --pidfile ${ZOOPIDFILE} -c zookeeper -x ${ZOOKEEPER_PREFIX}/bin/zkServer.sh
start; then
+	if start-stop-daemon --start --quiet --oknodo --pidfile ${ZOOPIDFILE} -c zookeeper -x ${ZOOKEEPER_PREFIX}/sbin/zkServer.sh
start; then
 	    log_end_msg 0
 	else
 	    log_end_msg 1
@@ -98,7 +109,7 @@ case "$1" in
 	    0)
 		# old daemon stopped
 		check_for_no_start log_end_msg
-		if start-stop-daemon --start --quiet --oknodo --pidfile ${ZOOPIDFILE} -c zookeeper -x ${ZOOKEEPER_PREFIX}/bin/zkServer.sh
start; then
+		if start-stop-daemon --start --quiet --oknodo --pidfile ${ZOOPIDFILE} -c zookeeper -x ${ZOOKEEPER_PREFIX}/sbin/zkServer.sh
start; then
 		    log_end_msg 0
 		else
 		    log_end_msg 1



Mime
View raw message