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:
commit
4b6ffe752e
@ -34,6 +34,8 @@ RUN rm /sbin/poweroff /sbin/reboot /sbin/halt && \
|
||||
COPY inputrc /etc/inputrc
|
||||
COPY growpart /usr/bin/growpart
|
||||
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 && \
|
||||
sed -i -e 's/duid/clientid/g' /etc/dhcpcd.conf && \
|
||||
sed -i 1,10d /etc/rsyslog.conf && \
|
||||
|
7
images/01-base/dhcpcd.debug
Normal file
7
images/01-base/dhcpcd.debug
Normal file
@ -0,0 +1,7 @@
|
||||
/var/log/dhcpcd.debug.log
|
||||
{
|
||||
rotate 7
|
||||
daily
|
||||
missingok
|
||||
copytruncate
|
||||
}
|
8
images/01-base/dhcpcd.enter-hook
Normal file
8
images/01-base/dhcpcd.enter-hook
Normal 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
|
Loading…
Reference in New Issue
Block a user