1
0
mirror of https://github.com/rancher/os.git synced 2025-07-12 14:18:01 +00:00

Merge pull request #2089 from SvenDowideit/add-dhcp-debug-hook

add a debug dump of the dhcp server
This commit is contained in:
Sven Dowideit 2017-09-13 16:21:31 +10:00 committed by GitHub
commit 4b6ffe752e
3 changed files with 17 additions and 0 deletions

View File

@ -34,6 +34,8 @@ RUN rm /sbin/poweroff /sbin/reboot /sbin/halt && \
COPY inputrc /etc/inputrc COPY inputrc /etc/inputrc
COPY growpart /usr/bin/growpart COPY growpart /usr/bin/growpart
COPY start_ntp.sh /bin/start_ntp.sh COPY start_ntp.sh /bin/start_ntp.sh
COPY dhcpcd.enter-hook /etc/dhcpcd.enter-hook
COPY dhcpcd.debug /usr/share/logrotate/logrotate.d/
RUN sed -i s/"partx --update \"\$part\" \"\$dev\""/"partx --update --nr \"\$part\" \"\$dev\""/g /usr/bin/growpart && \ RUN sed -i s/"partx --update \"\$part\" \"\$dev\""/"partx --update --nr \"\$part\" \"\$dev\""/g /usr/bin/growpart && \
sed -i -e 's/duid/clientid/g' /etc/dhcpcd.conf && \ sed -i -e 's/duid/clientid/g' /etc/dhcpcd.conf && \
sed -i 1,10d /etc/rsyslog.conf && \ sed -i 1,10d /etc/rsyslog.conf && \

View File

@ -0,0 +1,7 @@
/var/log/dhcpcd.debug.log
{
rotate 7
daily
missingok
copytruncate
}

View File

@ -0,0 +1,8 @@
#!/bin/bash
if [ "$(ros config get rancher.debug)" == "true" ]; then
echo "DHCPCD: $interface $reason" &>> /var/log/dhcpcd.debug.log
echo "$(date)" &>> /var/log/dhcpcd.debug.log
set | sed -ne 's/^new_//p' | sort &>> /var/log/dhcpcd.debug.log
echo "--------------------------" &>> /var/log/dhcpcd.debug.log
fi