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
diff --git a/debian/maas-dhcp.maas-dhcpd.service b/debian/maas-dhcp.maas-dhcpd.service
index b2d47ad..2001c66 100644
--- a/debian/maas-dhcp.maas-dhcpd.service
+++ b/debian/maas-dhcp.maas-dhcpd.service
@@ -23,6 +23,9 @@ ExecStart=/bin/sh -ec '\
23 chmod 775 /var/lib/maas/dhcp ; chmod 664 $LEASES_FILE; \23 chmod 775 /var/lib/maas/dhcp ; chmod 664 $LEASES_FILE; \
24 exec dhcpd -user dhcpd -group dhcpd -f -q -4 -pf /run/maas/dhcp/dhcpd.pid \24 exec dhcpd -user dhcpd -group dhcpd -f -q -4 -pf /run/maas/dhcp/dhcpd.pid \
25 -cf /var/lib/maas/dhcpd.conf -lf $LEASES_FILE $INTERFACES'25 -cf /var/lib/maas/dhcpd.conf -lf $LEASES_FILE $INTERFACES'
26# Require dhcpd stop in 8 seconds, if not kill it with 'mixed' mode.
27TimeoutStopSec=8
28KillMode=mixed
2629
27[Install]30[Install]
28WantedBy=multi-user.target31WantedBy=multi-user.target
diff --git a/debian/maas-dhcp.maas-dhcpd6.service b/debian/maas-dhcp.maas-dhcpd6.service
index 27e6873..8885bc4 100644
--- a/debian/maas-dhcp.maas-dhcpd6.service
+++ b/debian/maas-dhcp.maas-dhcpd6.service
@@ -23,6 +23,9 @@ ExecStart=/bin/sh -ec '\
23 chmod 775 /var/lib/maas/dhcp ; chmod 664 $LEASES_FILE; \23 chmod 775 /var/lib/maas/dhcp ; chmod 664 $LEASES_FILE; \
24 exec dhcpd -user dhcpd -group dhcpd -f -6 -pf /run/maas/dhcp/dhcpd6.pid \24 exec dhcpd -user dhcpd -group dhcpd -f -6 -pf /run/maas/dhcp/dhcpd6.pid \
25 -cf /var/lib/maas/dhcpd6.conf -lf $LEASES_FILE $INTERFACES'25 -cf /var/lib/maas/dhcpd6.conf -lf $LEASES_FILE $INTERFACES'
26# Require dhcpd stop in 8 seconds, if not kill it with 'mixed' mode.
27TimeoutStopSec=8
28KillMode=mixed
2629
27[Install]30[Install]
28WantedBy=multi-user.target31WantedBy=multi-user.target
diff --git a/src/provisioningserver/utils/service_monitor.py b/src/provisioningserver/utils/service_monitor.py
index 3f5e76f..139a73f 100644
--- a/src/provisioningserver/utils/service_monitor.py
+++ b/src/provisioningserver/utils/service_monitor.py
@@ -410,7 +410,7 @@ class ServiceMonitor:
410 raise ServiceActionError(error_msg)410 raise ServiceActionError(error_msg)
411 yield self._performServiceAction(service, "reload")411 yield self._performServiceAction(service, "reload")
412412
413 def _execCmd(self, cmd, env, timeout=5):413 def _execCmd(self, cmd, env, timeout=10):
414414
415 def decode(result):415 def decode(result):
416 out, err, code = result416 out, err, code = result

Subscribers

People subscribed via source and target branches