Package: lyskom-server
Version: 2.1.2-12
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 lyskom-server-2.1.2/debian/lyskom-server.dirs lyskom-server-2.1.2/debian/lyskom-server.dirs
--- lyskom-server-2.1.2/debian/lyskom-server.dirs
+++ lyskom-server-2.1.2/debian/lyskom-server.dirs
@@ -7 +6,0 @@
-var/run/lyskom-server
diff -u lyskom-server-2.1.2/debian/changelog lyskom-server-2.1.2/debian/changelog
--- lyskom-server-2.1.2/debian/changelog
+++ lyskom-server-2.1.2/debian/changelog
@@ -1,3 +1,11 @@
+lyskom-server (2.1.2-12.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Fixes wrong handling of var/run/lyskom-server life cycle (Closes: #XXXXXX).
+  * Now uses lsb-base to display messages.
+
+ -- Thomas Goirand <z...@debian.org>  Sat, 06 Oct 2012 21:05:23 +0800
+
 lyskom-server (2.1.2-12) unstable; urgency=low
 
   * Added Danish translation of Debconf templates.
diff -u lyskom-server-2.1.2/debian/lyskom-server.init.d lyskom-server-2.1.2/debian/lyskom-server.init.d
--- lyskom-server-2.1.2/debian/lyskom-server.init.d
+++ lyskom-server-2.1.2/debian/lyskom-server.init.d
@@ -19,6 +19,9 @@
 ### END INIT INFO
 
 PATH=/sbin:/bin:/usr/sbin:/usr/bin
+DESC="LysKOM server"
+NAME=komrunning
+RUNDIR=/var/run/lyskom-server
 
 if [ -f  /etc/default/lyskom-server ]; then
   . /etc/default/lyskom-server
@@ -26,28 +29,42 @@
 
 test -x /usr/sbin/komrunning || exit 0
 
+. /lib/lsb/init-functions
+
+start_lyskom (){
+  if [ ! -d ${RUNDIR} ] ; then
+    mkdir -p ${RUNDIR}
+    if [ -d ${RUNDIR} ] ; then
+      chown lyskom:nogroup ${RUNDIR}
+    fi
+  fi
+  /usr/sbin/komrunning start
+  return $?
+}
+
 case "$1" in
   start)
+    log_begin_msg "Starting ${DESC}" ${NAME}
     if test "$startonboot" = "NO"; then
-      echo "Automatic start of the LysKOM server from /etc/init.d is disabled."
+      log_failure_msg "Automatic start of the LysKOM server from /etc/init.d is disabled."
     else
-      sh $0 force-start
+      start_lyskom
     fi
+    log_end_msg 0
     ;;
 
   force-start)
-    echo -n "Signalling start of LysKOM server"
-    mkdir -p /var/run/lyskom-server
-    /usr/sbin/komrunning start
-    echo "."
+    log_begin_msg "Starting ${DESC}" ${NAME}
+    start_lyskom
+    log_end_msg 0
     ;;
 
   stop)
-    echo -n "Stopping LysKOM server"
+    log_begin_msg "Stopping ${DESC}" ${NAME}
     /usr/sbin/komrunning stop
-    rm -f /var/run/lyskom-server/pid
-    rm -f /var/run/lyskom-server/status
-    echo "."
+    rm -f ${RUNDIR}/pid
+    rm -f ${RUNDIR}/status
+    log_end_msg 0
     ;;
 
   restart|force-reload)

Reply via email to