Bug#782996: smsd: 'reload' function of initscript broken if used by systemd
Am 21.04.2015 um 15:15 schrieb Jonas Meurer: >> 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. > > According to release managers, this update won't make it into Jessie, > which is already in the quiet period (shortly before release). Instead, > a fixed package should be uploaded to stable-proposed-updates in order > to make it into the first point release of Jessie (8.1). > > If nobody speaks up, then I intend to upload the NMU to unstable next > week, wait one or two weeks and upload to stable-proposed-updates > afterwards. I just uploaded the NMU to unstable now. You find the final NMU diff attached to this mail. Only difference to my last patch is that the changelog entry contains the number of this bugreport now. I'll go ahead with an upload to stable-proposed-updates within the next days. Cheers, jonas diff -u smstools-3.1.15/debian/changelog smstools-3.1.15/debian/changelog --- smstools-3.1.15/debian/changelog +++ smstools-3.1.15/debian/changelog @@ -1,3 +1,17 @@ +smstools (3.1.15-1.2) unstable; urgency=high + + * NMU by Jonas Meurer to push the fix into Jessie. + * Fix initscript (debian/init.d): +* drop action 'reload' as it does not what policy demands it to do. Use + 'force-reload' in logrotate post-rotate action. This fixes 'force-reload' + action when used through systemd tools and prevents the smsd daemon + process from being killed at every log rotation. (closes: #782996) +* source /lib/lsb/init-functions in order to make systemd tools aware of + status changes to the daemon that have been caused by invoking the + initscript directly. + + -- Jonas Meurer Mon, 27 Apr 2015 20:45:40 +0200 + smstools (3.1.15-1.1) unstable; urgency=low * NMU - preventing smstools from entering jessie. diff -u smstools-3.1.15/debian/init.d smstools-3.1.15/debian/init.d --- smstools-3.1.15/debian/init.d +++ smstools-3.1.15/debian/init.d @@ -25,6 +25,8 @@ test -x $DAEMON || exit 0 +. /lib/lsb/init-functions + if [ ! -f /etc/default/$PACKAGE ] then exit 1 @@ -218,17 +220,6 @@ echo "$NAME." ;; - reload) - echo -n "Reloading $DESC: " - status - if [ "$?" = 0 ]; then - stop restart - start - else - echo "$NAME is not running." - fi - - ;; restart|force-reload) echo -n "Restarting $DESC: " @@ -237,7 +228,7 @@ ;; *) - 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 -u smstools-3.1.15/debian/logrotate smstools-3.1.15/debian/logrotate --- smstools-3.1.15/debian/logrotate +++ smstools-3.1.15/debian/logrotate @@ -5,5 +5,5 @@ missingok postrotate -invoke-rc.d smstools reload > /dev/null +invoke-rc.d smstools force-reload > /dev/null endscript }
Bug#782996: smsd: 'reload' function of initscript broken if used by systemd
Am 2015-04-21 15:15, schrieb Jonas Meurer: See the attached patch for a proper fix. I attached an updated patch. Argh, this time with the updated patch :) Cheers, jonasdiff -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.0 +0200 +++ smstools-3.1.15/debian/changelog 2015-04-21 15:13:32.668376587 +0200 @@ -1,3 +1,17 @@ +smstools (3.1.15-1.2) unstable; urgency=high + + * NMU by Jonas Meurer to push the fix into Jessie. + * Fix initscript (debian/init.d): +* drop action 'reload' as it does not what policy demands it to do. Use + 'force-reload' in logrotate post-rotate action. This fixes 'force-reload' + action when used through systemd tools and prevents the smsd daemon + process from being killed at every log rotation. (closes: #XX) +* source /lib/lsb/init-functions in order to make systemd tools aware of + status changes to the daemon that have been caused by invoking the + initscript directly. + + -- Jonas Meurer 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.0 +0200 +++ smstools-3.1.15/debian/init.d 2015-04-21 14:54:45.444351751 +0200 @@ -25,6 +25,8 @@ test -x $DAEMON || exit 0 +. /lib/lsb/init-functions + if [ ! -f /etc/default/$PACKAGE ] then exit 1 @@ -218,17 +220,6 @@ echo "$NAME." ;; - reload) - echo -n "Reloading $DESC: " - status - if [ "$?" = 0 ]; then - stop restart - start - else - echo "$NAME is not running." - fi - - ;; restart|force-reload) echo -n "Restarting $DESC: " @@ -237,7 +228,7 @@ ;; *) - 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.0 +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 }
Bug#782996: smsd: 'reload' function of initscript broken if used by systemd
Hi again, Am 2015-04-20 11:55, schrieb Jonas MEURER: 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. in some further discussion on IRC channel #debian-systemd, Michael Biebl made me aware that my fix was not policy-compliant. According to Debian Policy, 'force-reload' should reload the service if this function is available, and restart otherwise. Therefore I reverted the change to add a separate 'force-reload' action and kept 'force-reload' as an alias to 'restart'. Only the 'reload' option was dropped. Additionally, I added a line at the beginning of the initscript, sourcing '/lib/lsb/init-functions'. This is necessary to make systemd aware of status changes to the daemon that have been caused by running the initscript directly (i.e. not through systemd helper tools). This change is really non-intrusive and leads to a much better user experience. See the attached patch for a proper fix. I attached an updated patch. 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. According to release managers, this update won't make it into Jessie, which is already in the quiet period (shortly before release). Instead, a fixed package should be uploaded to stable-proposed-updates in order to make it into the first point release of Jessie (8.1). If nobody speaks up, then I intend to upload the NMU to unstable next week, wait one or two weeks and upload to stable-proposed-updates afterwards. Cheers, jonas -- To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Bug#782996: smsd: 'reload' function of initscript broken if used by systemd
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 libc62.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.0 +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: #XX) + + -- Jonas Meurer 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.0 +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.0 +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 }