Bug#689893: Ships a folder in /var/run or /var/lock (Policy Manual section 9.3.2)

2012-11-05 Thread Sébastien Villemot
Control: tags -1 + pending

Dear Maintainer,

Thomas Goirand z...@debian.org writes:

 Package: ircd-ircu
 Version: 2.10.12.10.dfsg1-1
 Severity: serious
 Tags: patch

 Andreas Beckmann deb...@abeckmann.de reported in -devel that your package
 (as well as 27 others) ships a folder either in /var/run or /var/lock. This
 is forbidden by policy.

[...]

 Please fix your package. I have attached what I believe is a good fix the
 problem, however, I haven't tried it, and I haven't tested if something more
 for creating the necessary folder at runtime should be added. Please make
 sure to test before applying the patch blindly.

I have uploaded to DELAYED/2 an NMU of ircd-ircu versioned
2.10.12.10.dfsg1-1.1, based on the patch by Thomas (I tested that the
patch works, and I just added the corresponding LaunchPad bug number).
The debdiff is attached. Please let me know if I should delay the upload
longer.

Regards,
diff -u ircd-ircu-2.10.12.10.dfsg1/debian/dirs ircd-ircu-2.10.12.10.dfsg1/debian/dirs
--- ircd-ircu-2.10.12.10.dfsg1/debian/dirs
+++ ircd-ircu-2.10.12.10.dfsg1/debian/dirs
@@ -4 +3,0 @@
-var/run/ircd
diff -u ircd-ircu-2.10.12.10.dfsg1/debian/changelog ircd-ircu-2.10.12.10.dfsg1/debian/changelog
--- ircd-ircu-2.10.12.10.dfsg1/debian/changelog
+++ ircd-ircu-2.10.12.10.dfsg1/debian/changelog
@@ -1,3 +1,12 @@
+ircd-ircu (2.10.12.10.dfsg1-1.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  
+  [ Thomas Goirand ]
+  * Fixes handling of /var/run/ircd life cycle (Closes: #689893, LP: #369115).
+
+ -- Sébastien Villemot sebast...@debian.org  Mon, 05 Nov 2012 20:04:25 +0100
+
 ircd-ircu (2.10.12.10.dfsg1-1) unstable; urgency=low
 
   * The Omertà release
diff -u ircd-ircu-2.10.12.10.dfsg1/debian/rules ircd-ircu-2.10.12.10.dfsg1/debian/rules
--- ircd-ircu-2.10.12.10.dfsg1/debian/rules
+++ ircd-ircu-2.10.12.10.dfsg1/debian/rules
@@ -92,7 +92,6 @@
 
 	# fix directory permissions for logdir
 	chown -R irc:irc debian/ircd-ircu/var/log/ircd
-	chown -R irc:irc debian/ircd-ircu/var/run/ircd
 
 	# move manpage
 	mv debian/ircd-ircu/usr/share/man/man8/ircd.8 debian/ircd-ircu/usr/share/man/man8/ircd-ircu.8
diff -u ircd-ircu-2.10.12.10.dfsg1/debian/init ircd-ircu-2.10.12.10.dfsg1/debian/init
--- ircd-ircu-2.10.12.10.dfsg1/debian/init
+++ ircd-ircu-2.10.12.10.dfsg1/debian/init
@@ -22,7 +22,15 @@
   
 # where the irc-daemon is
 IRCD=/usr/sbin/ircd-ircu
-PIDFILE=/var/run/ircd/ircd.pid  
+RUNDIR=/var/run/ircd
+PIDFILE=${RUNDIR}/ircd.pid  
+
+if [ ! -d ${RUNDIR} ] ; then
+	mkdir -p ${RUNDIR} || true
+	if [ -d ${RUNDIR} ] ; then
+		chown -R irc:irc ${RUNDIR}
+	fi
+fi
 
 if [ -x $IRCD ]; then
   case $1 in

-- 
 .''`.Sébastien Villemot
: :' :Debian Developer
`. `' http://www.dynare.org/sebastien
  `-  GPG Key: 4096R/381A7594


pgpdCpXsecdBd.pgp
Description: PGP signature


Bug#689893: Ships a folder in /var/run or /var/lock (Policy Manual section 9.3.2)

2012-10-07 Thread Thomas Goirand
Package: ircd-ircu
Version: 2.10.12.10.dfsg1-1
Severity: serious
Tags: patch

Dear Maintainer,

Andreas Beckmann deb...@abeckmann.de reported in -devel that your package
(as well as 27 others) ships a folder either in /var/run or /var/lock. This
is forbidden by policy.

Lintian detects the problem and warns as follow:

/var/run may be a temporary filesystem, so any directories or files needed
/there must be created dynamically at boot time.

Refer to Debian Policy Manual section 9.3.2 (Writing the scripts) for
details.

Severity: serious, Certainty: possible
Check: files, Type: binary, udeb

which is why I am reporting this bug with severity serious (and there fore,
release critical).

Please fix your package. I have attached what I believe is a good fix the
problem, however, I haven't tried it, and I haven't tested if something more
for creating the necessary folder at runtime should be added. Please make
sure to test before applying the patch blindly.

Cheers,

Thomas Goirand (zigo)
diff -u ircd-ircu-2.10.12.10.dfsg1/debian/dirs ircd-ircu-2.10.12.10.dfsg1/debian/dirs
--- ircd-ircu-2.10.12.10.dfsg1/debian/dirs
+++ ircd-ircu-2.10.12.10.dfsg1/debian/dirs
@@ -4 +3,0 @@
-var/run/ircd
diff -u ircd-ircu-2.10.12.10.dfsg1/debian/changelog ircd-ircu-2.10.12.10.dfsg1/debian/changelog
--- ircd-ircu-2.10.12.10.dfsg1/debian/changelog
+++ ircd-ircu-2.10.12.10.dfsg1/debian/changelog
@@ -1,3 +1,10 @@
+ircd-ircu (2.10.12.10.dfsg1-1.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Fixes handling of /var/run/ircd life cycle (Closes: #XX).
+
+ -- Thomas Goirand z...@debian.org  Sat, 06 Oct 2012 18:21:36 +0800
+
 ircd-ircu (2.10.12.10.dfsg1-1) unstable; urgency=low
 
   * The Omertà release
diff -u ircd-ircu-2.10.12.10.dfsg1/debian/rules ircd-ircu-2.10.12.10.dfsg1/debian/rules
--- ircd-ircu-2.10.12.10.dfsg1/debian/rules
+++ ircd-ircu-2.10.12.10.dfsg1/debian/rules
@@ -92,7 +92,6 @@
 
 	# fix directory permissions for logdir
 	chown -R irc:irc debian/ircd-ircu/var/log/ircd
-	chown -R irc:irc debian/ircd-ircu/var/run/ircd
 
 	# move manpage
 	mv debian/ircd-ircu/usr/share/man/man8/ircd.8 debian/ircd-ircu/usr/share/man/man8/ircd-ircu.8
diff -u ircd-ircu-2.10.12.10.dfsg1/debian/init ircd-ircu-2.10.12.10.dfsg1/debian/init
--- ircd-ircu-2.10.12.10.dfsg1/debian/init
+++ ircd-ircu-2.10.12.10.dfsg1/debian/init
@@ -22,7 +22,15 @@
   
 # where the irc-daemon is
 IRCD=/usr/sbin/ircd-ircu
-PIDFILE=/var/run/ircd/ircd.pid  
+RUNDIR=/var/run/ircd
+PIDFILE=${RUNDIR}/ircd.pid  
+
+if [ ! -d ${RUNDIR} ] ; then
+	mkdir -p ${RUNDIR} || true
+	if [ -d ${RUNDIR} ] ; then
+		chown -R irc:irc ${RUNDIR}
+	fi
+fi
 
 if [ -x $IRCD ]; then
   case $1 in