Package: gsmlib
Version: 1.10-13.2
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 gsmlib-1.10/debian/gsm-utils.postinst gsmlib-1.10/debian/gsm-utils.postinst
--- gsmlib-1.10/debian/gsm-utils.postinst
+++ gsmlib-1.10/debian/gsm-utils.postinst
@@ -19,7 +19,7 @@
 fi
 
 # echo Updating spool directory structure: /var/spool/sms
-chown -R gsmsms:gsmsms /var/spool/sms /var/run/gsm-utils
+chown -R gsmsms:gsmsms /var/spool/sms
 chmod 700 /var/spool/sms/*
 chmod 750 /var/spool/sms
 chmod 730 /var/spool/sms/queue* /var/spool/sms/tmp
diff -u gsmlib-1.10/debian/gsm-utils.dirs gsmlib-1.10/debian/gsm-utils.dirs
--- gsmlib-1.10/debian/gsm-utils.dirs
+++ gsmlib-1.10/debian/gsm-utils.dirs
@@ -11 +10,0 @@
-var/run/gsm-utils
diff -u gsmlib-1.10/debian/gsm-utils.init gsmlib-1.10/debian/gsm-utils.init
--- gsmlib-1.10/debian/gsm-utils.init
+++ gsmlib-1.10/debian/gsm-utils.init
@@ -42,7 +42,12 @@
 test -n "$SMSUSER" && STARTOPTS="$STARTOPTS --chuid $SMSUSER"
 test -r /etc/default/gsm-utils && . /etc/default/gsm-utils  # for overwriting OPTIONS
 
-mkdir -p /run/gsm-utils
+if [ ! -d /var/run/gsm-utils ] ; then
+	mkdir -p /var/run/gsm-utils || true
+	if [ -d /var/run/gsm-utils ] ; then
+		chown -R gsmsms:gsmsms /var/spool/sms /var/run/gsm-utils
+	fi
+fi
 
 case "$1" in
   start)
@@ -59,23 +64,23 @@
 		) >/dev/null 2>&1
 	fi
 	echo -n "$NAME"
-	start-stop-daemon --start --quiet --pidfile /run/gsm-utils/$NAME.pid \
+	start-stop-daemon --start --quiet --pidfile /var/run/gsm-utils/$NAME.pid \
 		--make-pidfile --background $STARTOPTS --exec $DAEMON -- $OPTIONS
 	echo "."
 	;;
   stop)
 	echo -n "Stopping $DESC: $NAME "
-	start-stop-daemon --stop --quiet --pidfile /run/gsm-utils/$NAME.pid \
+	start-stop-daemon --stop --quiet --pidfile /var/run/gsm-utils/$NAME.pid \
 		--exec $DAEMON
 	sleep 5
 	echo "."
 	;;
   restart|force-reload)
 	echo -n "Restarting $DESC: $NAME"
-	start-stop-daemon --stop --quiet --pidfile /run/gsm-utils/$NAME.pid \
+	start-stop-daemon --stop --quiet --pidfile /var/run/gsm-utils/$NAME.pid \
 		--make-pidfile --background --exec $DAEMON -- $OPTIONS
 	sleep 5
-	start-stop-daemon --start --quiet --pidfile /run/gsm-utils/$NAME.pid \
+	start-stop-daemon --start --quiet --pidfile /var/run/gsm-utils/$NAME.pid \
 		--make-pidfile --background $STARTOPTS --exec $DAEMON -- $OPTIONS
 	echo "."
 	;;
diff -u gsmlib-1.10/debian/gsm-utils.postrm gsmlib-1.10/debian/gsm-utils.postrm
--- gsmlib-1.10/debian/gsm-utils.postrm
+++ gsmlib-1.10/debian/gsm-utils.postrm
@@ -26,6 +26,7 @@
     purge)
        #deluser gsmsms  
 	/usr/sbin/userdel gsmsms
+	rm -rf /var/run/gsm-utils
     ;;
 
     *)
diff -u gsmlib-1.10/debian/changelog gsmlib-1.10/debian/changelog
--- gsmlib-1.10/debian/changelog
+++ gsmlib-1.10/debian/changelog
@@ -1,3 +1,10 @@
+gsmlib (1.10-13.3) UNRELEASED; urgency=low
+
+  * Non-maintainer upload.
+  * Fixes hanlding of /var/run/gsm-utils folder life cycle (Closes: #XXXXXX).
+
+ -- Thomas Goirand <z...@debian.org>  Sat, 06 Oct 2012 17:04:42 +0800
+
 gsmlib (1.10-13.2) unstable; urgency=low
 
   * Non-maintainer upload.

Reply via email to