Merge ~blake-rouse/maas:fix-dhcpd-restart-timeout into maas:master

Proposed by Blake Rouse
Status: Merged
Approved by: Blake Rouse
Approved revision: dfe9bd1ad21eb67121f9ddf651cc02897312d1bb
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~blake-rouse/maas:fix-dhcpd-restart-timeout
Merge into: maas:master
Diff against target: 41 lines (+7/-1)
3 files modified
debian/maas-dhcp.maas-dhcpd.service (+3/-0)
debian/maas-dhcp.maas-dhcpd6.service (+3/-0)
src/provisioningserver/utils/service_monitor.py (+1/-1)
Reviewer Review Type Date Requested Status
Mike Pontillo (community) Approve
Review via email: mp+355204@code.launchpad.net

Commit message

Fixes LP: #1792031 - Force dhcpd to restart in 8 seconds allow service monitor 10 seconds for a command to fail.

To post a comment you must log in.
Revision history for this message
Mike Pontillo (mpontillo) wrote :

+1!

review: Approve
Revision history for this message
Mike Pontillo (mpontillo) wrote :

I saw this in testing:

https://paste.ubuntu.com/p/vK84kgK43W/

We might consider making a similar change to the maas-http service.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/maas-dhcp.maas-dhcpd.service b/debian/maas-dhcp.maas-dhcpd.service
2index b2d47ad..2001c66 100644
3--- a/debian/maas-dhcp.maas-dhcpd.service
4+++ b/debian/maas-dhcp.maas-dhcpd.service
5@@ -23,6 +23,9 @@ ExecStart=/bin/sh -ec '\
6 chmod 775 /var/lib/maas/dhcp ; chmod 664 $LEASES_FILE; \
7 exec dhcpd -user dhcpd -group dhcpd -f -q -4 -pf /run/maas/dhcp/dhcpd.pid \
8 -cf /var/lib/maas/dhcpd.conf -lf $LEASES_FILE $INTERFACES'
9+# Require dhcpd stop in 8 seconds, if not kill it with 'mixed' mode.
10+TimeoutStopSec=8
11+KillMode=mixed
12
13 [Install]
14 WantedBy=multi-user.target
15diff --git a/debian/maas-dhcp.maas-dhcpd6.service b/debian/maas-dhcp.maas-dhcpd6.service
16index 27e6873..8885bc4 100644
17--- a/debian/maas-dhcp.maas-dhcpd6.service
18+++ b/debian/maas-dhcp.maas-dhcpd6.service
19@@ -23,6 +23,9 @@ ExecStart=/bin/sh -ec '\
20 chmod 775 /var/lib/maas/dhcp ; chmod 664 $LEASES_FILE; \
21 exec dhcpd -user dhcpd -group dhcpd -f -6 -pf /run/maas/dhcp/dhcpd6.pid \
22 -cf /var/lib/maas/dhcpd6.conf -lf $LEASES_FILE $INTERFACES'
23+# Require dhcpd stop in 8 seconds, if not kill it with 'mixed' mode.
24+TimeoutStopSec=8
25+KillMode=mixed
26
27 [Install]
28 WantedBy=multi-user.target
29diff --git a/src/provisioningserver/utils/service_monitor.py b/src/provisioningserver/utils/service_monitor.py
30index 3f5e76f..139a73f 100644
31--- a/src/provisioningserver/utils/service_monitor.py
32+++ b/src/provisioningserver/utils/service_monitor.py
33@@ -410,7 +410,7 @@ class ServiceMonitor:
34 raise ServiceActionError(error_msg)
35 yield self._performServiceAction(service, "reload")
36
37- def _execCmd(self, cmd, env, timeout=5):
38+ def _execCmd(self, cmd, env, timeout=10):
39
40 def decode(result):
41 out, err, code = result

Subscribers

People subscribed via source and target branches