Bug 53175 - univention-dhcp fails to install after initial join on non-primary
univention-dhcp fails to install after initial join on non-primary
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: DHCP
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0
Assigned To: Philipp Hahn
Jürn Brodersen
: interim-1
Depends on: 43688
Blocks:
  Show dependency treegraph
 
Reported: 2021-04-27 16:42 CEST by Philipp Hahn
Modified: 2021-05-25 16:03 CEST (History)
2 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 6: Setup Problem: Issue for the setup process
Who will be affected by this bug?: 3: Will affect average number of 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.206
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 2021-04-27 16:42:44 CEST
Installation of univention-dhcp fails on a non-primary systems already joined, which will be the norm with UCS 5.0-0 as USS no longer installs DHCP as part of the initial installation.

The problem is that
  univention-dhcp: Depends isc-dhcp-server-ldap: Depends isc-dhcp-server

/var/lib/dpkg/info/isc-dhcp-server.postinst tries to start the daemon with /etc/dhcp/dhcpd.conf already templated by univention-dhcp.
This will fail as the daemon will do a LDAP search first for
  (&(objectClass=dhcpServer)(cn=$hostname))
which is only created later by /usr/lib/univention-install/25univention-dhcp.inst when later it gets invoked from /var/lib/dpkg/info/univention-dhcp.postinst.

The failed start will abort isc-dhcp-server.postinst, which aborts the full package installation.

We have augmented isc-dhcp-server with /usr/lib/systemd/system/isc-dhcp-server.service.d/univention-dhcp.conf:
  ConditionPathExists=/etc/dhcp/dhcpd.conf
  ConditionPathExists=/var/univention-join/joined
which are both fulfilled as the system is already joined and the file exists.
Comment 1 Philipp Hahn univentionstaff 2021-04-27 18:48:13 CEST
[phahn/dhcp] a43f767a0c Bug #53175: Delay DHCP server start until after join
 services/univention-dhcp/25univention-dhcp.inst          |  1 +
 services/univention-dhcp/debian/changelog                |  6 +++++
 services/univention-dhcp/debian/univention-dhcp.postinst |  5 ++++
 services/univention-dhcp/debian/univention-dhcp.postrm   | 46 ++++++++++++++++++++++++++++++++++++
 services/univention-dhcp/univention-dhcp.conf            |  1 +
 5 files changed, 59 insertions(+)

[phahn/dhcp] 2a5c2bba9d Bug #53175: Restart DHCP server after join
 services/univention-dhcp/25univention-dhcp.inst | 1 +
 1 file changed, 1 insertion(+)


Package: univention-dhcp
Version: 14.0.4-1A~5.0.0.202104271840

OK: Upgrading old installation
OK: New installation

FYI: Also added a univention-dhcp.postrm for "apt prune".

No separate changelog as this is part of the transition to systemd Bug #43688
Comment 2 Jürn Brodersen univentionstaff 2021-05-06 12:03:15 CEST
What I tested:
prune cleans up -> OK
Installation (univention-dhcp) and start of "isc-dhcp-server":
primary -> OK
backup -> OK
replicant -> OK
managed -> OK
Installation before join -> service is stopped -> join -> service is started -> OK

No behavior changes -> No changelog necessary -> OK

-> Verified
Comment 3 Florian Best univentionstaff 2021-05-25 16:03:15 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".