-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for infinite DHCP leases
The proper way to do this would be to set the lease length in the libvirt network config, but unfortunately the version of libvirt we have in CentOS 8 right now doesn't support that. This adds a script that manually modifies the libvirt dnsmasq configuration to make the leases infinite. It is started in the background, and killed when make clean is run. It can be enabled by setting INFINITE_LEASES=1.
- Loading branch information
Showing
3 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
NETWORK_NAME=${CLUSTER_NAME}bm | ||
FILENAME=/var/lib/libvirt/dnsmasq/${NETWORK_NAME}.hostsfile | ||
|
||
# We need to keep running even after setting the infinite leases because | ||
# they are overwritten multiple times in the deployment process. | ||
while : | ||
do | ||
if grep -q -v infinite $FILENAME | ||
then | ||
sudo perl -pi -e 's/(.*?)(,infinite|)$/\1,infinite/' $FILENAME | ||
|
||
pid=$(ps aux | grep dnsmasq | grep "$NETWORK_NAME" | grep -v root | awk '{print $2}') | ||
sudo kill -s SIGHUP $pid | ||
echo "Added infinite leases to $FILENAME" | ||
fi | ||
sleep 10 | ||
done |