7c09728712
- Drop executable flag from NM dispatcher script to avoid dhcpd restart
24 lines
1.0 KiB
Bash
24 lines
1.0 KiB
Bash
#!/bin/bash
|
|
|
|
## this script is disabled by default
|
|
## if you want one to be executed on NM up events
|
|
## please make it executable. See chmod(1) for more details
|
|
|
|
INTERFACE=$1 # The interface which is brought up or down
|
|
STATUS=$2 # The new state of the interface
|
|
|
|
# whenever interface is brought up by NM (rhbz #565921)
|
|
if [ "$STATUS" = "up" ]; then
|
|
# wait a few seconds to allow interface startup to complete
|
|
# (important at boot time without this the service still fails
|
|
# time-out for dispatcher script is 3s (rhbz#1003695#8)
|
|
sleep 2
|
|
# restart the services
|
|
# In case this dispatcher script is called several times in a short period of time, it might happen that
|
|
# systemd refuses to further restart the units. Therefore we use reset-failed command to prevent it.
|
|
systemctl -q is-enabled dhcpd.service && systemctl restart dhcpd.service && systemctl reset-failed dhcpd.service
|
|
systemctl -q is-enabled dhcpd6.service && systemctl restart dhcpd6.service && systemctl reset-failed dhcpd6.service
|
|
fi
|
|
|
|
exit 0
|