[DRE-commits] [SCM] syncache.git branch, master, updated. upstream/1.0-5-g510d1f0

Dmitry Borodaenko angdraug at debian.org
Thu Sep 22 18:26:13 UTC 2011


The following commit has been merged in the master branch:
commit 510d1f05cfea37b78c6b525b53e1330434c12a47
Author: Dmitry Borodaenko <angdraug at debian.org>
Date:   Thu Sep 22 21:24:55 2011 +0300

    use --retry when stopping syncache-drb
    
    This ensures that init script waits for the daemon to shut down before
    trying to start it again during restart.

diff --git a/debian/syncache.init b/debian/syncache.init
index 3ae8a00..f785d33 100755
--- a/debian/syncache.init
+++ b/debian/syncache.init
@@ -68,35 +68,47 @@ test -f $DAEMON || exit 0
 
 set -e
 
+syncache_start () {
+	start-stop-daemon --start --pidfile $PIDFILE --name $PNAME \
+	    $NICE --oknodo --startas $DAEMON -- $OPTIONS
+}
+
+syncache_stop () {
+	start-stop-daemon --stop --pidfile $PIDFILE --oknodo --retry 3
+	rm -f $PIDFILE
+}
+
+syncache_reload () {
+	start-stop-daemon --stop --pidfile $PIDFILE --signal HUP
+}
+
 case "$1" in
   start)
 	log_begin_msg "Starting $DESC:"
 	log_progress_msg $NAME
-	start-stop-daemon --start --pidfile $PIDFILE --name $PNAME \
-	    $NICE --oknodo --startas $DAEMON -- $OPTIONS
+	syncache_start
 	log_end_msg $?
 	;;
 
   stop)
 	log_begin_msg "Stopping $DESC:"
 	log_progress_msg "$NAME"
-	start-stop-daemon --stop --pidfile $PIDFILE --oknodo
+	syncache_stop
 	log_end_msg $?
 	;;
 
   reload|force-reload)
 	log_begin_msg "Reloading $DESC:"
 	log_progress_msg $NAME
-	start-stop-daemon --stop --pidfile $PIDFILE --signal HUP
+	syncache_reload
 	log_end_msg $?
 	;;
 
   restart)
 	log_begin_msg "Restarting $DESC:"
 	log_progress_msg $NAME
-	start-stop-daemon --stop --pidfile $PIDFILE --oknodo
-	start-stop-daemon --start --pidfile $PIDFILE --name $PNAME \
-	    $NICE --oknodo --startas $DAEMON -- $OPTIONS
+	syncache_stop
+	syncache_start
 	log_end_msg $?
 	;;
 

-- 
syncache.git



More information about the Pkg-ruby-extras-commits mailing list