Bug 43688 - Convert DHCP from runit to systemd
Convert DHCP from runit to systemd
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: DHCP
UCS 4.4
Other Linux
: P5 normal (vote)
: UCS 5.0
Assigned To: Sebastian Lobinger
Philipp Hahn
: systemd
Depends on: 43685 43470 45173
Blocks: 43691 43330 52448 52828 52885 53175
  Show dependency treegraph
 
Reported: 2017-03-01 13:38 CET by Philipp Hahn
Modified: 2021-05-25 15:59 CEST (History)
2 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.114
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2017070321000483
Bug group (optional):
Max CVSS v3 score:
hahn: Patch_Available+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2017-03-01 13:38:59 CET
We should convert /etc/init.d/univention-dhcp to a isc-dhcp-server.service
This would allow us to remove runit.

- Fix /etc/runit/univention-dhcp/run:exec /usr/sbin/dhcpd -q -f >>/var/log/daemon.log breaking logrotate
- Consider handling of autostart UCRV (Bug #43470)
Comment 1 Philipp Hahn univentionstaff 2017-03-01 16:50:12 CET
When replacing runit by systemd, some join scripts/infrastructure must be updated to only start the service after joining:

# find / -xdev \( -name log -o -name dpkg -o -name init.d -o -name cache \) -prune -o -type f -exec grep -n --color /etc/runit/univention {} +

/usr/lib/univention-install/25univention-dhcp.inst:110:ln -s /etc/runit/univention-dhcp /etc/runit/univention/univention-dhcp >/dev/null 2>&1
/usr/lib/univention-install/90univention-bind-post.inst:88:if [ ! -e /etc/runit/univention/univention-bind-proxy ]; then
/usr/lib/univention-install/90univention-bind-post.inst:89:     ln -s /etc/runit/univention-bind-proxy /etc/runit/univention/univention-bind-proxy
/usr/lib/univention-install/90univention-bind-post.inst:92:if [ ! -e /etc/runit/univention/univention-bind-samba4 ]; then
/usr/lib/univention-install/90univention-bind-post.inst:93:     ln -s /etc/runit/univention-bind-samba4 /etc/runit/univention/univention-bind-samba4
/usr/lib/univention-install/02univention-directory-notifier.inst:38:ln -sf /etc/runit/univention-directory-notifier /etc/runit/univention/univention-directory-notifier
/usr/lib/univention-install/05univention-bind.inst:102:ln -s /etc/runit/univention-bind /etc/runit/univention/univention-bind >/dev/null 2>&1
/usr/lib/univention-install/03univention-directory-listener.inst:38:ln -sf /etc/runit/univention-directory-listener /etc/runit/univention/univention-directory-listener

/etc/logrotate.d/univention-directory-notifier:21: test -x /usr/bin/sv && test -e /etc/runit/univention/univention-directory-notifier && sv term univention-directory-notifier || true
/etc/logrotate.d/univention-dhcp:21: test -x /usr/bin/sv && test -e /etc/runit/univention/univention-dhcp && sv term univention-dhcp || true
/etc/logrotate.d/univention-directory-listener:21: test -x /usr/bin/sv && test -e /etc/runit/univention/univention-directory-listener && sv term univention-directory-listener || true

univention-join also has some internal knowledge of runit:

/usr/share/univention-join/univention-join:665: if [ -e "/etc/runit/univention/$service" ]
/usr/share/univention-join/univention-join:926:if [ -d /etc/runit/univention-directory-notifier ]; then
/usr/share/univention-join/univention-join:931:if [ -d /etc/runit/univention-directory-listener ]; then
Comment 2 Philipp Hahn univentionstaff 2017-03-29 15:28:39 CEST
This would also allow us to get rid of the "/etc/init.d/univention-dhcp shadows /etc/init.d/isc-dhcp-server" issue.
Comment 3 Philipp Hahn univentionstaff 2017-07-21 16:20:13 CEST
Happened multiple times during UCS Technical Training Task #6729:
DHCP fails to start because both "univention-dhcp" and "isc-dhcp-server" both try to start dhcpd - in the end none runs.
This happened multiple times, but not on all systems.

root@dc0:/etc/init.d# systemctl status \*dhcp\*
● isc-dhcp-server.service - LSB: DHCP server
   Loaded: loaded (/etc/init.d/isc-dhcp-server)
   Active: active (exited) since Fr 2017-07-21 08:17:29 CEST; 7h ago
  Process: 2067 ExecStart=/etc/init.d/isc-dhcp-server start (code=exited, status=0/SUCCESS)

Jul 21 08:17:29 dc0 systemd[1]: Starting LSB: DHCP server...
Jul 21 08:17:29 dc0 isc-dhcp-server[2067]: This script is disabled, use /etc/init.d/univention-dhcp..
Jul 21 08:17:29 dc0 systemd[1]: Started LSB: DHCP server.

● univention-dhcp.service - LSB: DHCP server
   Loaded: loaded (/etc/init.d/univention-dhcp)
   Active: failed (Result: exit-code) since Fr 2017-07-21 08:17:41 CEST; 7h ago
  Process: 2068 ExecStart=/etc/init.d/univention-dhcp start (code=exited, status=1/FAILURE)

Jul 21 08:17:40 dc0 univention-dhcp[2068]: Starting DHCP server: dhcpdtimeout: down: univention-dhcp: 44s, want up
Jul 21 08:17:41 dc0 univention-dhcp[2068]: failed!
Jul 21 08:17:41 dc0 systemd[1]: univention-dhcp.service: control process exited, code=exited status=1
Jul 21 08:17:41 dc0 systemd[1]: Failed to start LSB: DHCP server.
Jul 21 08:17:41 dc0 systemd[1]: Unit univention-dhcp.service entered failed state.
Comment 4 Stefan Gohmann univentionstaff 2017-07-24 08:55:16 CEST
Looks like it happens here also: Ticket #2017070321000483:

root@dc:~# systemctl status \*dhcp\*
● univention-dhcp.service - LSB: DHCP server
   Loaded: loaded (/etc/init.d/univention-dhcp)
   Active: failed (Result: exit-code) since Fr 2017-07-21 13:51:29 CEST; 2 days ago
  Process: 2095 ExecStart=/etc/init.d/univention-dhcp start (code=exited, status=1/FAILURE)

Jul 21 13:51:29 dc systemd[1]: univention-dhcp.service: control process exited, code=exited status=1
Jul 21 13:51:29 dc systemd[1]: Failed to start LSB: DHCP server.
Jul 21 13:51:29 dc systemd[1]: Unit univention-dhcp.service entered failed state.
Jul 21 13:51:29 dc univention-dhcp[2095]: Configuration file errors encountered -- exiting
Jul 21 13:51:29 dc univention-dhcp[2095]: If you think you have received this message due to a bug rather
Jul 21 13:51:29 dc univention-dhcp[2095]: than a configuration issue please read the section on submitting
Jul 21 13:51:29 dc univention-dhcp[2095]: bugs on either our web page at www.isc.org or in the README file
Jul 21 13:51:29 dc univention-dhcp[2095]: before submitting a bug.  These pages explain the proper
Jul 21 13:51:29 dc univention-dhcp[2095]: process and the information we find helpful for debugging..
Jul 21 13:51:29 dc univention-dhcp[2095]: exiting.

● isc-dhcp-server.service - LSB: DHCP server
   Loaded: loaded (/etc/init.d/isc-dhcp-server)
   Active: active (exited) since Fr 2017-07-21 13:51:26 CEST; 2 days ago
  Process: 2107 ExecStart=/etc/init.d/isc-dhcp-server start (code=exited, status=0/SUCCESS)

Jul 21 13:51:26 dc isc-dhcp-server[2107]: This script is disabled, use /etc/init.d/univention-dhcp..
Jul 21 13:51:26 dc systemd[1]: Started LSB: DHCP server.
root@dc:~#
Comment 5 Stefan Gohmann univentionstaff 2017-07-24 08:58:36 CEST
(In reply to Stefan Gohmann from comment #4)
> Looks like it happens here also: Ticket #2017070321000483:

In this case, the runsv process hasn't started the dhcp process even if the 'runsv univention-dhcp' process is running. After running 'sv up univention-dhcp' everything is working.
Comment 7 Stefan Gohmann univentionstaff 2017-07-25 11:26:54 CEST
The start problem has been fixed with Bug #45065.
Comment 8 Philipp Hahn univentionstaff 2019-08-14 11:16:56 CEST
<git:phahn/43688-dhcp-systemd>

Neither Debian nor upstream ISC are shipping systemd unit files.
There is some work-in-progress by Debian at <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=792894>.
Until then the systemd unit file generated by systemd-sysv-generator in /run/systemd/generator.late/isc-dhcp-server.service is used.
It gets augmented by /lib/systemd/system/isc-dhcp-server.service.d/univention-dhcp.conf.
This should allow the upstream package to have one /lib/systemd/system/isc-dhcp-server.service one day itself.
Comment 10 Philipp Hahn univentionstaff 2020-12-01 10:03:14 CET
Package: univention-dhcp
Version: 14.0.2-1A~5.0.0.202012010949
Branch: ucs_5.0-0

Package: univention-system-setup
Version: 13.0.2-3A~5.0.0.202012010958
Branch: ucs_5.0-0


OK: changelog
OK: UMC system
OK: ...
Comment 11 Philipp Hahn univentionstaff 2020-12-01 10:28:43 CET
[5.0-0] 148418ade4 Bug #43688 dhcp: Convert from runit to systemd
 services/univention-dhcp/debian/changelog | 6 ++++++
 services/univention-dhcp/debian/control   | 1 -
 2 files changed, 6 insertions(+), 1 deletion(-)

Remove dependency on univention-runit

Package: univention-dhcp
Version: 14.0.2-2A~5.0.0.202012011027
Branch: ucs_5.0-0
Comment 12 Florian Best univentionstaff 2021-05-25 15:59:32 CEST
UCS 5.0 has been released:
 https://docs.software-univention.de/release-notes-5.0-0-en.html
 https://docs.software-univention.de/release-notes-5.0-0-de.html

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