Package: smstools
Version: 3.1.15-1.1
Severity: serious

Hello,

the smstools initscript has a wrong implementation of the 'reload'
function which breaks if used through systemd tools. In fact, the 'reload'
function in smstools initscript doesn't reload the configuration of the
service without actually stopping and restarting the service. Instead, it
stops the service if it runs and restarts it afterwards. This is, what
'force-reload' is for.

As a result, 'invoke-rc.d smstools reload', 'service smstools reload' and
'systemctl reload smstools.service' all result in the smsd daemon being
killed and not restarted afterwards.

The smstools logrotate script runs 'invoke-rc.d smstools reload' as post-
rotate action, which leads to the smsd daemon process being killed 

The bug can be fixed by renaming the 'reload' function to 'force-reload'
and dropping the original 'force-reload' alias for 'restart'. Please note,
that fixing the 'Usage:' line by dropping 'reload' from the list of
supported actions is important as well. Otherwise, systemd tools try to
invoke 'reload' even if 'force-reload' is given as argument.

See the attached patch for a proper fix.

I consider this bug as release-critical for Jessie, as it renders
smmstools unusable on Jessie installations whenever logrotate is
installed. Thus I suggest to push the fix into Jessie within the next
days. I'll gladly do an NMU if the maintainer(s) don't have the time
to push this fix into Jessie in time.

Cheers,
 jonas

-- System Information:
Debian Release: 8.0
  APT prefers testing-updates
  APT policy: (500, 'testing-updates'), (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/20 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages smstools depends on:
ii  adduser  3.113+nmu3
ii  debconf  1.5.56
ii  libc6    2.19-18
ii  libmm14  1.4.2-5
ii  ucf      3.0030

smstools recommends no packages.

smstools suggests no packages.

-- debconf information:
  smstools/devicepin: (password omitted)
  smstools/modems/devicepin1: (password omitted)
  smstools/configureanothermodem: false
  smstools/eventhandler:
  smstools/modems/devicenode1: /dev/ttyS0
  smstools/configure: true
  smstools/modems/deviceinit1:
  smstools/modems/devicename1: GSM1
  smstools/devicebaudrate: 19200
  smstools/deviceinit:
  smstools/devicenode:
  smstools/configureanothermodem1: false
  smstools/devicename: GSM1
  smstools/modems/deviceincoming1: true
  smstools/devicenodeother:
  smstools/devicebaudrateother:
  smstools/modems/devicebaudrate1: 19200
  smstools/deviceincoming: true
diff -rNu smstools-3.1.15.orig/debian/changelog smstools-3.1.15/debian/changelog
--- smstools-3.1.15.orig/debian/changelog	2015-04-20 11:46:00.000000000 +0200
+++ smstools-3.1.15/debian/changelog	2015-04-20 11:52:23.746207040 +0200
@@ -1,3 +1,14 @@
+smstools (3.1.15-1.2) unstable; urgency=high
+
+  * NMU by Jonas Meurer to push the fix into Jessie.
+  * Fix initscript: rename action 'reload' to 'force-reload' and drop 'reload'
+    from supported actions. Use 'force-reload' in logrotate post-rotate action.
+    This fixes 'force-reload' function when used through systemd tools and
+    prevents the smsd daemon process from being killed at every log rotation.
+    (closes: #XXXXXX)
+
+ -- Jonas Meurer <jo...@freesources.org>  Mon, 20 Apr 2015 11:46:53 +0200
+
 smstools (3.1.15-1.1) unstable; urgency=low
 
   * NMU - preventing smstools from entering jessie.
diff -rNu smstools-3.1.15.orig/debian/init.d smstools-3.1.15/debian/init.d
--- smstools-3.1.15.orig/debian/init.d	2015-04-20 11:46:00.000000000 +0200
+++ smstools-3.1.15/debian/init.d	2015-04-20 11:46:38.266199428 +0200
@@ -218,7 +218,7 @@
 		echo "$NAME."
 
 	;;
-	reload)
+	force-reload)
 		echo -n "Reloading $DESC: "
 		status
 		if [ "$?" = 0 ]; then
@@ -230,14 +230,14 @@
 		
 	;;
 
-	restart|force-reload)
+	restart)
 		echo -n "Restarting $DESC: "
 		stop restart
 		start
 	;;
 
 	*)
-		echo "Usage: /etc/init.d/$NAME {start|stop|force-stop|reload|force-reload|restart|status}"
+		echo "Usage: /etc/init.d/$NAME {start|stop|force-stop|force-reload|restart|status}"
 		exit 3
 	;;
 esac
diff -rNu smstools-3.1.15.orig/debian/logrotate smstools-3.1.15/debian/logrotate
--- smstools-3.1.15.orig/debian/logrotate	2015-04-20 11:46:00.000000000 +0200
+++ smstools-3.1.15/debian/logrotate	2015-04-20 11:46:50.426199696 +0200
@@ -4,6 +4,6 @@
     compress
     missingok
     postrotate
-        invoke-rc.d smstools reload > /dev/null
+        invoke-rc.d smstools force-reload > /dev/null
     endscript
 }

Reply via email to