Package: tetrinetx
Version: 1.13.16-13
Severity: serious
Tags: patch

Dear Maintainer,

Andreas Beckmann <[email protected]> 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 tetrinetx-1.13.16/debian/dirs tetrinetx-1.13.16/debian/dirs
--- tetrinetx-1.13.16/debian/dirs
+++ tetrinetx-1.13.16/debian/dirs
@@ -1,5 +1,4 @@
 etc/tetrinetx
 usr/games
-var/run/tetrinetx
 var/log/tetrinetx
 var/games/tetrinetx
diff -u tetrinetx-1.13.16/debian/rules tetrinetx-1.13.16/debian/rules
--- tetrinetx-1.13.16/debian/rules
+++ tetrinetx-1.13.16/debian/rules
@@ -3,7 +3,6 @@
 CFLAGS=-O2 -DUSE_IPV6 -fno-strength-reduce -Wall -fsigned-char -I/usr/include -L/usr/lib
 DESTDIR=$(CURDIR)/debian/tetrinetx/
 OWNDIRS= $(DESTDIR)var/games/tetrinetx \
-	 $(DESTDIR)var/run/tetrinetx \
 	 $(DESTDIR)var/log/tetrinetx \
 	 $(DESTDIR)etc/tetrinetx
 
diff -u tetrinetx-1.13.16/debian/init tetrinetx-1.13.16/debian/init
--- tetrinetx-1.13.16/debian/init
+++ tetrinetx-1.13.16/debian/init
@@ -13,8 +13,9 @@
 
 NAME="tetrinetx"
 DESC="Tetrinet Server"
-PIDF="/var/run/tetrinetx/game.pid"
-LOGF="/var/log/tetrinetx/game.log"
+RUNDIR="/var/run/tetrinetx"
+PIDF="${RUNDIR}/game.pid"
+LOGF="${RUNDIR}/game.log"
 CONF="/etc/tetrinetx/game.conf"
 BINX="/usr/games/tetrinetx"
 
@@ -30,6 +31,13 @@
   fi
 fi
 
+if [ ! -d ${RUNDIR} ] ; then
+	mkdir -p ${RUNDIR} || true
+	if [ -d ${RUNDIR} ] ; then
+		chown -R games:games ${RUNDIR}
+	fi
+fi
+
 case "$ACTION" in
 	start|start-now)
 	  echo -n "Starting ${DESC}: "
diff -u tetrinetx-1.13.16/debian/changelog tetrinetx-1.13.16/debian/changelog
--- tetrinetx-1.13.16/debian/changelog
+++ tetrinetx-1.13.16/debian/changelog
@@ -1,3 +1,10 @@
+tetrinetx (1.13.16-13.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Fixes /var/run/tetrinetx life cycle (Closes: #XXXXXX).
+
+ -- Thomas Goirand <[email protected]>  Sat, 06 Oct 2012 22:56:18 +0800
+
 tetrinetx (1.13.16-13) unstable; urgency=low
 
   * Update homepage (Closes: #515049)
only in patch2:
unchanged:
--- tetrinetx-1.13.16.orig/debian/postrm
+++ tetrinetx-1.13.16/debian/postrm
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+set -e
+
+if [ "${1}" = "purge" ] ; then
+	rm -rf /var/run/tetrinetx
+fi
+
+#DEBHELPER#

Reply via email to