Bug 42380 - Switch to systemd - breaks UCS-4.2 update due to startup dependency loop in network stack
Switch to systemd - breaks UCS-4.2 update due to startup dependency loop in n...
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: General
UCS 4.2
Other Linux
: P4 normal (vote)
: UCS 4.2
Assigned To: Philipp Hahn
Janek Walkenhorst
: interim-2, systemd
Depends on: 38438 43313
Blocks: 43330
  Show dependency treegraph
 
Reported: 2016-09-14 09:49 CEST by Philipp Hahn
Modified: 2017-09-26 10:47 CEST (History)
3 users (show)

See Also:
What kind of report is it?: Release Management
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2016-09-14 09:49:25 CEST
Debian-Jessie uses systemd by default.
This breaks the update to 4.2 during reboot, as there is a circular dependency in the network stack: During startup all /etc/network/if-up.d/ scripts are run, which themselves call back to (re-)start other init scripts while systemd is still trying to get networking.service started:

298 /bin/bash -e /etc/init.d/networking start
393 \_ ifup -a
510    \_ /bin/sh -c run-parts --exit-on-error /etc/network/if-up.d
511       \_ run-parts --exit-on-error /etc/network/if-up.d
518          \_ /bin/sh /etc/network/ip-up.d/05_rdate
519             \_ /bin/sh /usr/sbin/invoke-rc.d rdate start
537                \_ systemctl start rdate.service
...
546          \_ /bin/sh /etc/network/ip-up.d/30_univention-directory-policy
519             \_ /bin/sh /usr/sbin/invoke-rc.d univention-directory-policy start
537                \_ systemctl start univention-directory-policy.service

With systemd it is its jobs to restart services as interfaces come and go. As such those scripts should be removed from if-up.d/ *iff* we go the systemd way. That would probably breaks systems, where systemd is *not* used.
On the positive side removing those scripts would solve the problem, that the services are currently restarted for each interface, which is a pain if many interfaces/bridges/bonds/vlans are used; see Bug #32481 and Bug #39334


Another option would be to disable those scripts if systemd is used, which I have done for now:
/etc/network/ucs-network-tools:34
> [ -d /run/systemd/system ] && exit 0


Another (probably) problematic case is saml/univention-saml/debian/univention-saml.init, which directly invokes the init scripts of "memcahced" and "stunnel4", which would be another loop.

There may be other cases where init scripts call other init scripts; I have declared them as LSB-dependencies, but they should be checked again carefully.

+++ This bug was initially created as a clone of Bug #38438 +++
Comment 1 Philipp Hahn univentionstaff 2016-09-14 09:54:10 CEST
(In reply to Philipp Hahn from comment #0)
> Another option would be to disable those scripts if systemd is used, which I
> have done for now:
> /etc/network/ucs-network-tools:34
> > [ -d /run/systemd/system ] && exit 0

r72562 | Bug #42380 net: Disable (re-)starting services when systemd is used.
 Work-around for now; revert as needed

Package: univention-network-manager
Version: 9.0.0-3A~4.2.0.201609140952
Branch: ucs_4.2-0
Comment 2 Philipp Hahn univentionstaff 2016-12-22 14:12:59 CET
r75516 | Bug #42380 runit: clamp Max-delay to 5s

Package: univention-runit
Version: 8.0.0-3A~4.2.0.201612221406
Branch: ucs_4.2-0

r75517 | Bug #42380 bind: Depend on fixed runit

Package: univention-bind
Version: 11.0.0-7A~4.2.0.201612221408
Branch: ucs_4.2-0
Comment 3 Arvid Requate univentionstaff 2017-02-01 16:38:42 CET
Bug 42389 dropped the 070_bind9_restart.patch for bind9 (Bug 29659), this should be covered.
Comment 4 Arvid Requate univentionstaff 2017-02-01 19:34:53 CET
Regarding Comment 3, maybe this has been dealt with in bind9 itself. Quoting the changelog:

bind9 (1:9.9.5.dfsg-8) unstable; urgency=medium

  * Launch rndc command in the background in networking scripts to avoid a
    hang in named from bringing down the entire network (closes: #760555).

 -- Michael Gilbert <mgilbert@debian.org>  Thu, 01 Jan 2015 17:51:52 +0000
Comment 5 Philipp Hahn univentionstaff 2017-02-28 17:23:10 CET
works-for-me

r77173 | Bug #42380: systemd networking
Comment 6 Janek Walkenhorst univentionstaff 2017-03-05 19:47:58 CET
(In reply to Philipp Hahn from comment #1)
> r72562 | Bug #42380 net: Disable (re-)starting services when systemd is used.
OK
(In reply to Philipp Hahn from comment #2)
> r75516 | Bug #42380 runit: clamp Max-delay to 5s
OK
> r75517 | Bug #42380 bind: Depend on fixed runit
OK

(In reply to Philipp Hahn from comment #5)
> r77173 | Bug #42380: systemd networking
OK
Comment 7 Stefan Gohmann univentionstaff 2017-04-04 18:28:28 CEST
UCS 4.2 has been released:
 https://docs.software-univention.de/release-notes-4.2-0-en.html
 https://docs.software-univention.de/release-notes-4.2-0-de.html

If this error occurs again, please use "Clone This Bug".