Package: couriergraph
Version: 0.25-4.1
Severity: normal
Tags: patch pending

Dear maintainer,

I've prepared an NMU for couriergraph (versioned as 0.25-4.2) and
uploaded it to DELAYED/3. Please feel free to tell me if I
should delay it longer.

Regards,
Salvatore
diff -u couriergraph-0.25/debian/changelog couriergraph-0.25/debian/changelog
--- couriergraph-0.25/debian/changelog
+++ couriergraph-0.25/debian/changelog
@@ -1,3 +1,18 @@
+couriergraph (0.25-4.2) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Don't provide /var/run/servergraph in binary package.
+    Fix "Ships a folder in /var/run or /var/lock (Policy Manual section
+    9.3.2)". Create /var/run/servergraph in initscript if
+    /var/run/servergraph is not present.
+    Thanks to Thomas Goirand <z...@debian.org> (Closes: #689884)
+  * Check if daemon pid file is present and don't start daemon.
+    Check if daemon pid is present. If pid file is present assume the daemon
+    is still running and do not start another instance.
+    This is otherwise a Debian Policy 9.3.2 violation. (Closes: #692157)
+
+ -- Salvatore Bonaccorso <car...@debian.org>  Fri, 02 Nov 2012 20:19:26 +0100
+
 couriergraph (0.25-4.1) unstable; urgency=low
 
   * Non-maintainer upload.
diff -u couriergraph-0.25/debian/dirs couriergraph-0.25/debian/dirs
--- couriergraph-0.25/debian/dirs
+++ couriergraph-0.25/debian/dirs
@@ -4 +3,0 @@
-var/run/servergraph
diff -u couriergraph-0.25/debian/init couriergraph-0.25/debian/init
--- couriergraph-0.25/debian/init
+++ couriergraph-0.25/debian/init
@@ -14,7 +14,8 @@
 DESC="Courier login Statistics"
 DAEMON=/usr/sbin/couriergraph.pl
 
-PIDFILE=/var/run/servergraph/couriergraph.pid
+PIDDIR=/var/run/servergraph
+PIDFILE=$PIDDIR/couriergraph.pid
 RRD_DIR=/var/lib/couriergraph
 RRD_NAME=couriergraph
 
@@ -23,14 +24,25 @@
 if [ -f $CONFIG ]; then
         . $CONFIG
 fi
- 
+
+if [ ! -d $PIDDIR ]; then
+	mkdir -p $PIDDIR
+	chown daemon:root $PIDDIR
+fi
+
 case "$1" in
   start)
 	echo -n "Starting $DESC: "
-	start-stop-daemon --start --quiet --pidfile $PIDFILE \
-		--exec $DAEMON -N 15 -c daemon:adm -- \
-		-l $MAIL_LOG -d --daemon_rrd=$RRD_DIR --rrd_name=$RRD_NAME
-	echo "$NAME."
+	# No pidfile, probably no daemon present
+	if [ -f "$PIDFILE" ]; then
+		echo "already running."
+		exit 1
+	else
+		start-stop-daemon --start --quiet --pidfile $PIDFILE \
+			--exec $DAEMON -N 15 -c daemon:adm -- \
+			-l $MAIL_LOG -d --daemon_rrd=$RRD_DIR --rrd_name=$RRD_NAME
+		echo "$NAME."
+	fi
   ;;
 
   stop)
diff -u couriergraph-0.25/debian/postinst couriergraph-0.25/debian/postinst
--- couriergraph-0.25/debian/postinst
+++ couriergraph-0.25/debian/postinst
@@ -27,7 +27,6 @@
 #     installation fails and the `postinst' is called with `abort-upgrade',
 #     `abort-remove' or `abort-deconfigure'.
 
-RUNDIR=/var/run/servergraph
 DATADIR=/var/lib/couriergraph
 CACHEDIR=/var/cache/couriergraph
 DEFAULTS=/etc/default/couriergraph
@@ -35,9 +34,6 @@
 case "$1" in
     configure)
 
-	mkdir -p $RUNDIR || true
-	chown daemon:root $RUNDIR
-
 	if [ ! -d $DATADIR ]; then mkdir $DATADIR; fi
 	chown root:adm $DATADIR
 	chmod 775 $DATADIR

Attachment: signature.asc
Description: Digital signature

Reply via email to