[Python-modules-commits] r29735 - in packages/fedmsg/trunk/debian (5 files)

olasd at users.alioth.debian.org olasd at users.alioth.debian.org
Sun Jul 13 08:29:50 UTC 2014


    Date: Sunday, July 13, 2014 @ 08:29:48
  Author: olasd
Revision: 29735

Fix init scripts so that the daemons really get launched (Closes: #752895)

Modified:
  packages/fedmsg/trunk/debian/changelog
  packages/fedmsg/trunk/debian/fedmsg-gateway.init
  packages/fedmsg/trunk/debian/fedmsg-hub.init
  packages/fedmsg/trunk/debian/fedmsg-irc.init
  packages/fedmsg/trunk/debian/fedmsg-relay.init

Modified: packages/fedmsg/trunk/debian/changelog
===================================================================
--- packages/fedmsg/trunk/debian/changelog	2014-07-13 02:44:20 UTC (rev 29734)
+++ packages/fedmsg/trunk/debian/changelog	2014-07-13 08:29:48 UTC (rev 29735)
@@ -1,3 +1,9 @@
+fedmsg (0.8.0-2) UNRELEASED; urgency=high
+
+  * Fix init scripts so that the daemons really get launched (Closes: #752895)
+
+ -- Nicolas Dandrimont <olasd at debian.org>  Sun, 13 Jul 2014 09:13:47 +0200
+
 fedmsg (0.8.0-1) unstable; urgency=medium
 
   * New upstream release

Modified: packages/fedmsg/trunk/debian/fedmsg-gateway.init
===================================================================
--- packages/fedmsg/trunk/debian/fedmsg-gateway.init	2014-07-13 02:44:20 UTC (rev 29734)
+++ packages/fedmsg/trunk/debian/fedmsg-gateway.init	2014-07-13 08:29:48 UTC (rev 29735)
@@ -14,8 +14,8 @@
 PATH=/sbin:/usr/sbin:/bin:/usr/bin
 DESC="gateway daemon for the fedmsg bus"
 NAME=fedmsg-gateway
-DAEMON=/usr/sbin/$NAME
-PIDFILE=/var/run/$NAME.pid
+DAEMON=/usr/bin/$NAME
+PIDFILE=/var/run/fedmsg/$NAME.pid
 SCRIPTNAME=/etc/init.d/$NAME
 USER=fedmsg
 
@@ -32,18 +32,23 @@
 
 do_start()
 {
+        if ! [ -d /var/run/fedmsg ]; then
+                mkdir /var/run/fedmsg
+                chown $USER /var/run/fedmsg
+        fi
+
 	start-stop-daemon --start --quiet --user $USER --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
 		|| return 1
-	start-stop-daemon --start --quiet --user $USER --pidfile $PIDFILE --exec $DAEMON \
+	start-stop-daemon --start --quiet --user $USER --pidfile $PIDFILE --chuid $USER --background --startas /bin/sh -- -c "( $DAEMON 2>&1 & echo \$! > $PIDFILE ) | logger -p daemon.info -t $NAME &" \
 		|| return 2
 }
 
 do_stop()
 {
-	start-stop-daemon --stop --quiet --user $USER --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
+	start-stop-daemon --stop --retry=TERM/30/KILL/5 --quiet --user $USER --pidfile $PIDFILE
 	RETVAL="$?"
 	[ "$RETVAL" = 2 ] && return 2
-	start-stop-daemon --stop --quiet --user $USER --oknodo --retry=0/30/KILL/5 --exec $DAEMON
+	start-stop-daemon --stop --retry=0/30/KILL/5 --oknodo --quiet --user $USER --pidfile $PIDFILE
 	[ "$?" = 2 ] && return 2
 	rm -f $PIDFILE
 	return "$RETVAL"

Modified: packages/fedmsg/trunk/debian/fedmsg-hub.init
===================================================================
--- packages/fedmsg/trunk/debian/fedmsg-hub.init	2014-07-13 02:44:20 UTC (rev 29734)
+++ packages/fedmsg/trunk/debian/fedmsg-hub.init	2014-07-13 08:29:48 UTC (rev 29735)
@@ -14,8 +14,8 @@
 PATH=/sbin:/usr/sbin:/bin:/usr/bin
 DESC="producer/consumer hub daemon for the fedmsg bus"
 NAME=fedmsg-hub
-DAEMON=/usr/sbin/$NAME
-PIDFILE=/var/run/$NAME.pid
+DAEMON=/usr/bin/$NAME
+PIDFILE=/var/run/fedmsg/$NAME.pid
 SCRIPTNAME=/etc/init.d/$NAME
 USER=fedmsg
 
@@ -32,18 +32,23 @@
 
 do_start()
 {
+        if ! [ -d /var/run/fedmsg ]; then
+                mkdir /var/run/fedmsg
+                chown $USER /var/run/fedmsg
+        fi
+
 	start-stop-daemon --start --quiet --user $USER --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
 		|| return 1
-	start-stop-daemon --start --quiet --user $USER --pidfile $PIDFILE --exec $DAEMON \
+	start-stop-daemon --start --quiet --user $USER --pidfile $PIDFILE --chuid $USER --background --startas /bin/sh -- -c "( $DAEMON 2>&1 & echo \$! > $PIDFILE ) | logger -p daemon.info -t $NAME &" \
 		|| return 2
 }
 
 do_stop()
 {
-	start-stop-daemon --stop --quiet --user $USER --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
+	start-stop-daemon --stop --retry=TERM/30/KILL/5 --quiet --user $USER --pidfile $PIDFILE
 	RETVAL="$?"
 	[ "$RETVAL" = 2 ] && return 2
-	start-stop-daemon --stop --quiet --user $USER --oknodo --retry=0/30/KILL/5 --exec $DAEMON
+	start-stop-daemon --stop --retry=0/30/KILL/5 --oknodo --quiet --user $USER --pidfile $PIDFILE
 	[ "$?" = 2 ] && return 2
 	rm -f $PIDFILE
 	return "$RETVAL"

Modified: packages/fedmsg/trunk/debian/fedmsg-irc.init
===================================================================
--- packages/fedmsg/trunk/debian/fedmsg-irc.init	2014-07-13 02:44:20 UTC (rev 29734)
+++ packages/fedmsg/trunk/debian/fedmsg-irc.init	2014-07-13 08:29:48 UTC (rev 29735)
@@ -14,8 +14,8 @@
 PATH=/sbin:/usr/sbin:/bin:/usr/bin
 DESC="IRC bot for the fedmsg bus"
 NAME=fedmsg-irc
-DAEMON=/usr/sbin/$NAME
-PIDFILE=/var/run/$NAME.pid
+DAEMON=/usr/bin/$NAME
+PIDFILE=/var/run/fedmsg/$NAME.pid
 SCRIPTNAME=/etc/init.d/$NAME
 USER=fedmsg
 
@@ -32,18 +32,23 @@
 
 do_start()
 {
+        if ! [ -d /var/run/fedmsg ]; then
+                mkdir /var/run/fedmsg
+                chown $USER /var/run/fedmsg
+        fi
+
 	start-stop-daemon --start --quiet --user $USER --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
 		|| return 1
-	start-stop-daemon --start --quiet --user $USER --pidfile $PIDFILE --exec $DAEMON \
+	start-stop-daemon --start --quiet --user $USER --pidfile $PIDFILE --chuid $USER --background --startas /bin/sh -- -c "( $DAEMON 2>&1 & echo \$! > $PIDFILE ) | logger -p daemon.info -t $NAME &" \
 		|| return 2
 }
 
 do_stop()
 {
-	start-stop-daemon --stop --quiet --user $USER --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
+	start-stop-daemon --stop --retry=TERM/30/KILL/5 --quiet --user $USER --pidfile $PIDFILE
 	RETVAL="$?"
 	[ "$RETVAL" = 2 ] && return 2
-	start-stop-daemon --stop --quiet --user $USER --oknodo --retry=0/30/KILL/5 --exec $DAEMON
+	start-stop-daemon --stop --retry=0/30/KILL/5 --oknodo --quiet --user $USER --pidfile $PIDFILE
 	[ "$?" = 2 ] && return 2
 	rm -f $PIDFILE
 	return "$RETVAL"

Modified: packages/fedmsg/trunk/debian/fedmsg-relay.init
===================================================================
--- packages/fedmsg/trunk/debian/fedmsg-relay.init	2014-07-13 02:44:20 UTC (rev 29734)
+++ packages/fedmsg/trunk/debian/fedmsg-relay.init	2014-07-13 08:29:48 UTC (rev 29735)
@@ -14,8 +14,8 @@
 PATH=/sbin:/usr/sbin:/bin:/usr/bin
 DESC="relay daemon for the fedmsg bus"
 NAME=fedmsg-relay
-DAEMON=/usr/sbin/$NAME
-PIDFILE=/var/run/$NAME.pid
+DAEMON=/usr/bin/$NAME
+PIDFILE=/var/run/fedmsg/$NAME.pid
 SCRIPTNAME=/etc/init.d/$NAME
 USER=fedmsg
 
@@ -32,18 +32,23 @@
 
 do_start()
 {
+        if ! [ -d /var/run/fedmsg ]; then
+                mkdir /var/run/fedmsg
+                chown $USER /var/run/fedmsg
+        fi
+
 	start-stop-daemon --start --quiet --user $USER --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
 		|| return 1
-	start-stop-daemon --start --quiet --user $USER --pidfile $PIDFILE --exec $DAEMON \
+	start-stop-daemon --start --quiet --user $USER --pidfile $PIDFILE --chuid $USER --background --startas /bin/sh -- -c "( $DAEMON 2>&1 & echo \$! > $PIDFILE ) | logger -p daemon.info -t $NAME &" \
 		|| return 2
 }
 
 do_stop()
 {
-	start-stop-daemon --stop --quiet --user $USER --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
+	start-stop-daemon --stop --retry=TERM/30/KILL/5 --quiet --user $USER --pidfile $PIDFILE
 	RETVAL="$?"
 	[ "$RETVAL" = 2 ] && return 2
-	start-stop-daemon --stop --quiet --user $USER --oknodo --retry=0/30/KILL/5 --exec $DAEMON
+	start-stop-daemon --stop --retry=0/30/KILL/5 --oknodo --quiet --user $USER --pidfile $PIDFILE
 	[ "$?" = 2 ] && return 2
 	rm -f $PIDFILE
 	return "$RETVAL"




More information about the Python-modules-commits mailing list