theypsilon / Update_All_MiSTer

All-in-one script for updating your MiSTer
GNU General Public License v3.0
605 stars 27 forks source link

Issue with dhcpcd / DNS record #83

Open ojaksch opened 2 years ago

ojaksch commented 2 years ago

Moving an issue from here as Sorgelig doesn't want to adapt this to MiSTer's Linux-Build. Maybe you will adapt two lines of code (umount ... and dhcpcd -k) to dont_download.sh just before line 1148 ("reboot now") to ensure a proper reboot of MiSTer for those user who are using network mounts and/or "advanced networks" like I'm doing.

I'm running a well hung local DHCP/DNS setup, which is setting top-notch names in my local DNS zone. When rebooting the MiSTer, dhcpcd (the init script) doesn't release it's IP and DNS, so the DNS record is "already set" and the DNS server grumbles about this.

This is tolerable, but from time to time the DHCP server argues that "this IP address and DNS record is already in state and active", > gives another IP and the DNS record ("forward map") fails. So no resolvable name and an unknown IP.

A proper fix would be easy by instructing dhcpcd to release it's settings just before shutting down the network interface:


--- S40network.org
+++ S40network
@@ -14,7 +14,9 @@
;;
stop)
printf "Stopping network: "
-       /sbin/ifdown -a
+       /usr/bin/umount -f -a -t cifs -t nfs4 -t nfs
+       /usr/sbin/dhcpcd -k
+       /sbin/ifdown -a --exclude=lo
[ $? = 0 ] && echo "OK" || echo "FAIL"
;;
restart|reload)

> As you can see, in my case I'm unmounting all possible network ressources I'm using somethimes just to be sure. A shutdown of the network interface _without_ unmount leads to a hanging system when rebooting. If nothing is mounted, the unmount command keep quite and is doing nothing.