[debian-lan-devel] [debian-lan] 03/03: Make the dhcpd commit handler idempotent
Afif Elghraoui
afif at moszumanska.debian.org
Sun Nov 20 07:49:02 UTC 2016
This is an automated email from the git hooks/post-receive script.
afif pushed a commit to branch experimental
in repository debian-lan.
commit 6227ed1aad761eb058d274ff4902ec0dde55ad51
Author: Afif Elghraoui <afif at debian.org>
Date: Sat Nov 19 23:40:49 2016 -0800
Make the dhcpd commit handler idempotent
The `on commit` code executes every time the host binds or
rebinds its address. We only need to initialize the PXE configuration
when the address is first assigned.
---
fai/config/files/usr/local/sbin/debian-lan/SERVER_A | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/fai/config/files/usr/local/sbin/debian-lan/SERVER_A b/fai/config/files/usr/local/sbin/debian-lan/SERVER_A
index 1b7ab12..ad0aca8 100755
--- a/fai/config/files/usr/local/sbin/debian-lan/SERVER_A
+++ b/fai/config/files/usr/local/sbin/debian-lan/SERVER_A
@@ -303,6 +303,12 @@ case $COMMAND in
chboot)
MACHINE=$1
IP=$2
+ pxecfg=$(printf '%02X%02X%02X%02X' $(echo $IP | tr '.' ' '))
+ pxeroot=/srv/tftp/fai/pxelinux.cfg
+ if [ -f $pxeroot/$pxecfg ] || [ -f $pxeroot/$pxecfg.disable ]
+ then
+ exit 0
+ fi
NAME=${MACHINE//[0-9]/}
LOG=/var/log/chboot.log
. /etc/fai/nfsroot.conf
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/debian-lan.git
More information about the debian-lan-devel
mailing list