Your message dated Tue, 24 Jun 2014 15:44:35 +0000
with message-id <e1wzstf-0001qs...@franck.debian.org>
and subject line Bug#751472: fixed in systemd 204-11
has caused the Debian Bug report #751472,
regarding /lib/lsb/init-functions.d/40-systemd: init script integration: set 
+e; set +u changes behavior of init scripts
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
751472: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=751472
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: systemd
Version: 208-1
Severity: normal
File: /lib/lsb/init-functions.d/40-systemd

/lib/lsb/init-functions.d/40-systemd unconditionally uses "set +e; set
+u". This can change the behavior of init scripts that use "set -e"
and/or "set -u".

The systemd integration should not rely on "set +e" or "set +u", but
instead work correctly in all cases:

Instead of "set +u", access variables in a way that doesn't trigger an
exception when the variable is not set: "${foo:-}" will result in an
empty string when foo is not set.

Instead of "set +e", explicitly catch commands that might fail, for example

  something-that-might-fail || :

It is still okay to use "set +e; set +u" in the redirection code when
control is not returned to the init script.

I've attached an *untested* patch implementing what I described
above. Not sure if I missed anything.

Ansgar
diff --git a/debian/init-functions.d/40-systemd b/debian/init-functions.d/40-systemd
index a213afc..809ec7a 100644
--- a/debian/init-functions.d/40-systemd
+++ b/debian/init-functions.d/40-systemd
@@ -1,21 +1,18 @@
 # -*-Shell-script-*-
 # /lib/lsb/init-functions
 
+_use_systemctl=0
 if [ -d /run/systemd/system ]; then
-    # Some init scripts use "set -e" and "set -u", we don't want that
-    # here
-    set +e
-    set +u
 
-    if [ -n "$DPKG_MAINTSCRIPT_PACKAGE" ]; then
+    if [ -n "${DPKG_MAINTSCRIPT_PACKAGE:-}" ]; then
     # If we are called by a maintainer script, chances are good that a
     # new or updated sysv init script was installed.  Reload daemon to
     # pick up any changes.
-        systemctl daemon-reload
+        systemctl daemon-reload || :
     fi
 
     # Redirect SysV init scripts when executed by the user
-    if [ $PPID -ne 1 ] && [ -z "$init" ] && [ -z "$_SYSTEMCTL_SKIP_REDIRECT" ]; then
+    if [ $PPID -ne 1 ] && [ -z "${init:-}" ] && [ -z "${_SYSTEMCTL_SKIP_REDIRECT:-}" ]; then
         case $(readlink -f "$0") in
             /etc/init.d/*)
                 _use_systemctl=1
@@ -23,7 +20,7 @@ if [ -d /run/systemd/system ]; then
                 # but can through the init script.
                 prog=${0##*/}
                 service="${prog%.sh}.service"
-                if [ "$(systemctl -p CanReload show $service 2>/dev/null)" = "CanReload=no" ] && [ "$1" = "reload" ]; then
+                if [ "$(systemctl -p CanReload show $service 2>/dev/null)" = "CanReload=no" ] && [ "${1:-}" = "reload" ]; then
                     _use_systemctl=0
                 fi
                 ;;
@@ -31,8 +28,6 @@ if [ -d /run/systemd/system ]; then
     else
         export _SYSTEMCTL_SKIP_REDIRECT="true"
     fi
-else
-    _use_systemctl=0
 fi
 
 systemctl_redirect () {
@@ -73,6 +68,11 @@ systemctl_redirect () {
 }
 
 if [ "$_use_systemctl" = "1" ]; then
+    # Some init scripts use "set -e" and "set -u", we don't want that
+    # here
+    set +e
+    set +u
+
     if  [ "x$1" = xstart -o \
         "x$1" = xstop -o \
         "x$1" = xrestart -o \

--- End Message ---
--- Begin Message ---
Source: systemd
Source-Version: 204-11

We believe that the bug you reported is fixed in the latest version of
systemd, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 751...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Michael Biebl <bi...@debian.org> (supplier of updated systemd package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Tue, 24 Jun 2014 17:03:43 +0200
Source: systemd
Binary: systemd systemd-sysv libpam-systemd libsystemd-login0 
libsystemd-login-dev libsystemd-daemon0 libsystemd-daemon-dev 
libsystemd-journal0 libsystemd-journal-dev libsystemd-id128-0 
libsystemd-id128-dev udev libudev1 libudev-dev udev-udeb libudev1-udeb 
libgudev-1.0-0 gir1.2-gudev-1.0 libgudev-1.0-dev python-systemd systemd-dbg
Architecture: source amd64
Version: 204-11
Distribution: unstable
Urgency: medium
Maintainer: Debian systemd Maintainers 
<pkg-systemd-maintainers@lists.alioth.debian.org>
Changed-By: Michael Biebl <bi...@debian.org>
Description:
 gir1.2-gudev-1.0 - libgudev-1.0 introspection data
 libgudev-1.0-0 - GObject-based wrapper library for libudev
 libgudev-1.0-dev - libgudev-1.0 development files
 libpam-systemd - system and service manager - PAM module
 libsystemd-daemon-dev - systemd utility library - development files
 libsystemd-daemon0 - systemd utility library
 libsystemd-id128-0 - systemd 128 bit ID utility library
 libsystemd-id128-dev - systemd 128 bit ID utility library - development files
 libsystemd-journal-dev - systemd journal utility library - development files
 libsystemd-journal0 - systemd journal utility library
 libsystemd-login-dev - systemd login utility library - development files
 libsystemd-login0 - systemd login utility library
 libudev-dev - libudev development files
 libudev1   - libudev shared library
 libudev1-udeb - libudev shared library (udeb)
 python-systemd - python bindings for systemd
 systemd    - system and service manager
 systemd-dbg - system and service manager (debug symbols)
 systemd-sysv - system and service manager - SysV links
 udev       - /dev/ and hotplug management daemon
 udev-udeb  - /dev/ and hotplug management daemon (udeb)
Closes: 739113 746351 747741 748355 751472 751589
Changes:
 systemd (204-11) unstable; urgency=medium
 .
   [ Martin Pitt ]
   * Explain patch management in debian/README.source. (Closes: #739113)
   * Replace "Always probe cpu support drivers" patch with cherry-picked
     upstream fix which is more general.
   * Advertise hibernation only if there's enough free swap. Patches backported
     from current upstream. (LP: #1313522)
   * Fix typo in sg loading rule to make it actually work.
 .
   [ Michael Biebl ]
   * Make no-patch-numbers the default for gbp-pq.
   * Cherry-pick upstream fix to properly handle multiline syslog messages.
     (Closes: #746351)
   * Cherry-pick upstream fix for libudev which fixes a memleak in
     parent_add_child().
   * Drop "-b debian" from Vcs-Git since we use the master branch for
     packaging now.
   * Drop Conflicts: sysvinit (<< 2.88dsf-44~) from systemd-sysv since this
     breaks dist-upgrades from wheezy when switching from sysvinit to
     systemd-sysv as default init. While downgrading the Pre-Depends in
     sysvinit would have been an alternative, dropping the Conflicts and only
     keeping the Replaces was deemed the lesser evil. (Closes: #748355)
   * Use Conflicts instead of Breaks against sysvinit-core. This avoids
     /sbin/init going missing when switching from systemd-sysv to sysvinit.
     While at it, add a Replaces: upstart. (Closes: #751589)
   * Make the SysV compat tools try both /run/initctl and /dev/initctl. This
     makes them usable under sysvinit as PID 1 without requiring any symlinks.
   * Various ifupdown integration fixes
     - Use DefaultDependencies=no in ifup@.service so the service can be
       started as early as possible.
     - Create the ifupdown runtime directory in ifup@.service as we can no
       longer rely on the networking service to do that for us.
     - Don't stop ifup@.service on shutdown but let the networking service take
       care of stopping all hotplugged interfaces.
     - Only start ifup@.service for interfaces configured as allow-hotplug.
 .
   [ Michael Stapelberg ]
   * Clarify that “systemd” does not influence init whereas “systemd-sysv” does
     (Closes: #747741)
 .
   [ Ansgar Burchardt ]
   * Don't use "set +e; set +u" unconditionally in the lsb init-functions hook
     as this might change the behaviour of existing SysV init scripts.
     (Closes: #751472)
Checksums-Sha1:
 9f5e78cba2056ddeed6046c1b7752b41e4d24958 3971 systemd_204-11.dsc
 d5db843c8e10d72bb79bd2a27f1087f222c1d857 101640 systemd_204-11.debian.tar.xz
 8ba252bd8bb39c2193d1cde58fdd1ffa26f38099 1151574 systemd_204-11_amd64.deb
 337ea53c9d162940e9e77d8d8d10799d2cc4b020 23396 systemd-sysv_204-11_amd64.deb
 6406f42150eab04be5c9bc78990484647c5224ec 39574 libpam-systemd_204-11_amd64.deb
 e8fe221007596d21e9914833bb28741401848ab3 39404 
libsystemd-login0_204-11_amd64.deb
 741db67b87cb40b5826027bb6385981de27f15d1 32584 
libsystemd-login-dev_204-11_amd64.deb
 5d134cfba56e9064d3520c8caa8b4c45db04a162 23122 
libsystemd-daemon0_204-11_amd64.deb
 2247d113c67204ed2798ab9c8b2fedf3b371d06e 33850 
libsystemd-daemon-dev_204-11_amd64.deb
 0a10a3e9022b1c53856612838a621a0cd9bfc95a 63358 
libsystemd-journal0_204-11_amd64.deb
 7ef4f6b28745a0e27212c5a554640706de9bb94a 47738 
libsystemd-journal-dev_204-11_amd64.deb
 a03cc28afdb19d25c190bc3b1a95871c6b01ac48 27114 
libsystemd-id128-0_204-11_amd64.deb
 1212b6d98f028055eadb16f49d06dc9261f651bc 25380 
libsystemd-id128-dev_204-11_amd64.deb
 f67cf4861d5448b1d39d71d6fb5e05f1b1ca47aa 765512 udev_204-11_amd64.deb
 3617448aa9ec8c1e492e6682ab326d6fdfe61b66 47132 libudev1_204-11_amd64.deb
 9986945068b88fcf8dd7d299a915477482d4bfb9 23438 libudev-dev_204-11_amd64.deb
 0997156aafe19e027322bc87d3b3d1a9e65ff318 139764 udev-udeb_204-11_amd64.udeb
 fcb80efc4f7c5773d0fd2fe32a74b38200a14519 28408 libudev1-udeb_204-11_amd64.udeb
 2956e1148cf36c368d5d3a407856d8fd3ace6f55 29106 libgudev-1.0-0_204-11_amd64.deb
 f5358d7000a365d4aa18a32352bb3b7b1408687f 2796 gir1.2-gudev-1.0_204-11_amd64.deb
 e7c27381e42e885acde4881965cd37d2cdc71273 24178 
libgudev-1.0-dev_204-11_amd64.deb
 3503a6117c0055b32aa6bab285407c1b7ca97081 47246 python-systemd_204-11_amd64.deb
 cdf8344a3c54f26b12ed868979a8a2f8b2084527 13727248 systemd-dbg_204-11_amd64.deb
Checksums-Sha256:
 d8e154cecd357c4e964179ac26eab45d59f93730adf5f8c6c2342fc69fc48811 3971 
systemd_204-11.dsc
 08a4693fb9525022cc84106a33280c8d0dbd8edfb96cdedcbbc430642ac9c451 101640 
systemd_204-11.debian.tar.xz
 7d5b4ea8bb132a63c581667de37e0b74ddcb6022cb8c0bd1ea575d8a03f6fbfd 1151574 
systemd_204-11_amd64.deb
 39f41e7fdad950d1aac6b9ae1e006d52b15e4d717e6b79611ef7d0fe6f9ce597 23396 
systemd-sysv_204-11_amd64.deb
 72e2b4b330d599752f81e6a116d7f3916cc123a6f27ece306cd8cc2440896883 39574 
libpam-systemd_204-11_amd64.deb
 80ffce3f436821ffb700564543703580167ca0a78f47943278abe455df7d90b4 39404 
libsystemd-login0_204-11_amd64.deb
 fc8c5aeb171b73d00780d27b0db1c762832a24a5ada5712482472ca68ed994f1 32584 
libsystemd-login-dev_204-11_amd64.deb
 fe7e5005ff8fdd9fb7ef4d75e8b10ab60babc5f7dd90c537fd27c6fe59d4f059 23122 
libsystemd-daemon0_204-11_amd64.deb
 92ad0b8e381dfbd214cce00b802a70fb258cf38b0a234b7f2e4550bea6902c0f 33850 
libsystemd-daemon-dev_204-11_amd64.deb
 c8461297ef1ff4019f2ec6ca9394281ac3496453105df827083583051459bea8 63358 
libsystemd-journal0_204-11_amd64.deb
 96a166d4bfbce37b6e78261bdd62c15e4af0ddcc22384a7e06a4fb04b9d32372 47738 
libsystemd-journal-dev_204-11_amd64.deb
 8481aeea57eb97c1088cb21b3fb1213d655d068c9f1852ec93e8ba9cfa3dc680 27114 
libsystemd-id128-0_204-11_amd64.deb
 bfea5b343dc063aa535fde391070e053714e707b376ca1f73e775d2da98dfa52 25380 
libsystemd-id128-dev_204-11_amd64.deb
 8839a18d101570fbba1a98bee9ec008b83993ed38a0dac9aee5bf289ba9d33d9 765512 
udev_204-11_amd64.deb
 94b675fdb7cd54500f4483fe5b173a3c0cdf5d86e77ec293931051a034bfc0a8 47132 
libudev1_204-11_amd64.deb
 4b90980a6f9677bee14b6196c67c91a6a1155a0743f8afd6992778defe115f70 23438 
libudev-dev_204-11_amd64.deb
 857760b817f6c88ffd078e6f3a938ec49acb50b937135e113c53dfa5caba6085 139764 
udev-udeb_204-11_amd64.udeb
 d3b22962f9527eaf9e88c840fd191d9668e8fd10d21af2e3499b479f719ce2d2 28408 
libudev1-udeb_204-11_amd64.udeb
 d22232bdd7df2730bc04f8a9898a7aec790291cc29facef639186c4722fe0158 29106 
libgudev-1.0-0_204-11_amd64.deb
 5d103d0856417bdde74afd4acfdbcb62a75f75819f4f0432545be35266593e2a 2796 
gir1.2-gudev-1.0_204-11_amd64.deb
 3bb13d81ec0456b693da5926e14b2e2ba7da369a37e7ffa9c849b9857de2e4ef 24178 
libgudev-1.0-dev_204-11_amd64.deb
 926f6d27950cb112ffc8b426d54d135fbd50de020996656ff7659e331ff9ca66 47246 
python-systemd_204-11_amd64.deb
 a8db7983b1b09f7190549ec9f3100fe21fe528412f11853df134ce5fa74b338e 13727248 
systemd-dbg_204-11_amd64.deb
Files:
 06009ea59c5025b889ebb25d28db1fe6 1151574 admin optional 
systemd_204-11_amd64.deb
 572d097e83288970130cb4409cb3dd23 23396 admin extra 
systemd-sysv_204-11_amd64.deb
 5c0c5fed3ed0466160b3df4bc7fafdbb 39574 admin optional 
libpam-systemd_204-11_amd64.deb
 9f392c14edada6e888571980d9fcac26 39404 libs optional 
libsystemd-login0_204-11_amd64.deb
 5d8a5e7c901695fb5aa1ec49ac2390d7 32584 libdevel optional 
libsystemd-login-dev_204-11_amd64.deb
 beb290c981d0f4044bcd9022b6444ab9 23122 libs optional 
libsystemd-daemon0_204-11_amd64.deb
 ff2368d2d1f814db2f0c57ce570bf85f 33850 libdevel optional 
libsystemd-daemon-dev_204-11_amd64.deb
 97fdb3c06f136686ec61cb2a5ed80a43 63358 libs optional 
libsystemd-journal0_204-11_amd64.deb
 842001b3b9adc96ae64eeb8b897dadb6 47738 libdevel optional 
libsystemd-journal-dev_204-11_amd64.deb
 2ac63c6b84afa6d4b108bc9151c512a6 27114 libs optional 
libsystemd-id128-0_204-11_amd64.deb
 e5563aef074a76f7ab4a6684ce10291c 25380 libdevel optional 
libsystemd-id128-dev_204-11_amd64.deb
 b51d3681a461b5f6ff89cf3ee21dc2ce 765512 admin important udev_204-11_amd64.deb
 89ffd186ad615cb080c2838c94d5ccda 47132 libs important libudev1_204-11_amd64.deb
 cc213df186023d72649c04475fbe9fa5 23438 libdevel optional 
libudev-dev_204-11_amd64.deb
 15aa786db8bc5a64a164272ea1607ad4 139764 debian-installer optional 
udev-udeb_204-11_amd64.udeb
 897b5285c38240461b26103b6eb62d1a 28408 debian-installer optional 
libudev1-udeb_204-11_amd64.udeb
 13b1819a5bdfc4faafaba4edb30cb069 29106 libs optional 
libgudev-1.0-0_204-11_amd64.deb
 5359d370a909f9b3fc3747f811d393fb 2796 introspection optional 
gir1.2-gudev-1.0_204-11_amd64.deb
 53db91250faf16cc79b4c35627537c77 24178 libdevel optional 
libgudev-1.0-dev_204-11_amd64.deb
 d4d32b7fa56b233351a2406213f91c1e 47246 python optional 
python-systemd_204-11_amd64.deb
 7560d459e5888dbf944b57809af1b238 13727248 debug extra 
systemd-dbg_204-11_amd64.deb
 2f25eda8579c61b2b1336fcd6f9ac379 3971 admin optional systemd_204-11.dsc
 718811d82854c6ce6f92f21137d04288 101640 admin optional 
systemd_204-11.debian.tar.xz
Package-Type: udeb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCAAGBQJTqZTpAAoJEGrh3w1gjyLct5gP/AxCMbiPjCuaQHgWfb69dVGw
FMsMJaRi1rOISq+8I8eRn2KcQ7ZN5dGefwlFPt6FUYcq05bxgAUP5FrnBeswaq0Q
AfNkvNJGeN9Agv84l8QKC+yw7M5g3cSMRbwPYFLjHp/fgUSxpiC9QZRnt2BuwDjH
nGqBe6toBx/ZwrC8s09z/Z6TelsA6Yn3zLrSkMgfx14qZ+t4GEVMHchxpR4bZQqr
XPCvlEXXklrSojTK9GOvIG6H15zVUiZbLXI9K+o/qIj8rCmBxL9yJyGYR0Gz6hbk
tIRdGytSP2GY3XsINznQH2fZnfHtxRRlqb5bntPJDp5SkSIfEeI9FKfM5IHEfe65
TSyhLIXIModaukbrfPnlEhbseH3l42Uw8lc1GGOuMndJvvqqDQmq7kwXNiYS9ikS
6ecmewONsQi70TFNhsbvz8ZpNe1J1odnvKHhJvyLrJRM5ZeFmcsuOJANwj+6I1Hm
cnXdbQJzQD+FL89xHdWrjHOMylOzGxoJRsSfThNSlwTkfqJedWAhgDkeA216otjE
y3E15n8hyDYXiEM/3jcFh/Uclkwcc51b+3JS/9xzQ+oQpYfr3ELwuvd88jB02Mhw
WOJ6QJNDdvck3sPmFH8JzTbyG6nkX5iGGVcHxmzbi4ZY8ERU1FF51pmT4HdOOHj7
H9vx9ckg2Gv+OSDBxGDD
=Vwni
-----END PGP SIGNATURE-----

--- End Message ---
_______________________________________________
Pkg-systemd-maintainers mailing list
Pkg-systemd-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-systemd-maintainers

Reply via email to