mirror of
https://github.com/CumulusNetworks/ifupdown2.git
synced 2024-05-06 15:54:50 +00:00
ifreload causes unnecessary dhcp restart for eth0
Ticket: CM-5730 Reviewed By: roopa Testing Done: tested change on Sean and Jason's lab setup The dhcp restart on all interfaces using dhcp causes a reconnection for NTP and in addition, a recent addition of rack management packages (CM-5782) added ntp and a exit-hook script that also interrupted NTP for a second time. This patch will check for dhclient running (IPv4 and IPv6) and not restart dhcp if it's already running.
This commit is contained in:
@@ -23,6 +23,12 @@ class dhcp(moduleBase):
|
|||||||
self.ipcmd = None
|
self.ipcmd = None
|
||||||
|
|
||||||
def _up(self, ifaceobj):
|
def _up(self, ifaceobj):
|
||||||
|
# if dhclient is already running do not stop and start it
|
||||||
|
if self.dhclientcmd.is_running(ifaceobj.name) or \
|
||||||
|
self.dhclientcmd.is_running6(ifaceobj.name):
|
||||||
|
self.logger.info('dhclient already running on %s. Not restarting.' % \
|
||||||
|
ifaceobj.name)
|
||||||
|
return
|
||||||
try:
|
try:
|
||||||
if ifaceobj.addr_family == 'inet':
|
if ifaceobj.addr_family == 'inet':
|
||||||
# First release any existing dhclient processes
|
# First release any existing dhclient processes
|
||||||
|
Reference in New Issue
Block a user