Upgrade Network Woes


#21

I have to echo @Miki_J experience. My setup had been working fine, but after the recent stable update, it need a route add default 192.168.5.1 for networking to work despite having the line:

defaultrouter="192.168.5.1"

in /etc/rc.conf. There have been no other hardware or software changes associated with this system or the network. Other machines not running TrueOS continued to work correctly on this network. And like the OP, the only difference in my rc.conf after the upgrade is:

$ diff -u /etc/rc.conf{.preUpgrade,}
--- /etc/rc.conf.preUpgrade	2017-12-17 09:51:57.230929000 -0800
+++ /etc/rc.conf	2018-03-30 07:37:49.545990000 -0700
@@ -3,7 +3,6 @@
 defaultrouter="192.168.5.1"
 ntpd_enable="YES"
 kldload_nvidia="nvidia-modeset nvidia"
-kldload_i915kms=""
 rpcbind_enable="YES"
 nfs_server_enable="YES"
 firewall_enable="NO"

#22

welcome to tracking FreeBSD 12-current


#23

Hmm. I have a static IP config, with a defaultrouter defined and did not have any issue after upgrade.

Is your default router in the same subnet as one of the interfaces? I think if you try to add the default route and it can’t figure out which interface to go out it may fail. Maybe look at the /etc/init.d scripts, figure out where it’s adding the default route and try logging more info?


#24

Yes, the default is in the same subnet as my one and only interface:

% pciconf -lv | grep -c network
1

em0@pci0:0:31:6: class=0x020000 card=0x06b91028 chip=0x1
5b78086 rev=0x31 hdr=0x00
vendor = ‘Intel Corporation’
device = ‘Ethernet Connection (2) I219-LM’
class = network
subclass = ethernet


#25

Ok. If adding the route by hand after the interface is up, then to me that implies a timing issue during boot: the default route is being added but the routing code can’t figure out “how to get there”, because the em0 interface is not up or hasn’t gotten it’s address yet.

/etc/init.d/routing is the code that sets up the default route, the depend() clause has “need localmount” and “use net”.
there should be a /etc/init.d/network.em0 that is a symlink to /etc/init.d/network, that does a “provide net”.
I don’t know if the “use net” in the routing script should be “need net” or “after net” but you could look at trueos repos on github to see if there were any changes in the routing init script. Heck if it worked fine before, you can use beadm to mount the previous BE in a temp location and then do a compare between the working and nonworking scripts.

Long winded way of saying “potential race condition between the routing and network scripts during boot”.

Edit:
man openrc-run gives good info. The way I read it the “use net” in the routing script will attempt to start the network script, but it’s unclear if it will wait for it. Perhaps in routing change the “use net” to “after net” which means it routing will not start until after network has been started.


#26

I tried to boot my old BE, but it won’t boot now, but I did change “use net” to “after net” and still have to manually add the default route.


#27

Ok. Not sure where to go from here.


#28

Well, thanks, regardless, but I do wonder if these Segmentation faults (evolution and cups_browsed) have anything to do with it. I have uninstalled and reinstalled evolution to no avail.


#29

I modified /etc/init.d/routing script to add after net in the depend function, and then sprinkled logger(1) statements in various places. The output from dmesg seems to indicate that the interface is up before the routing configuration begins:

Apr 11 06:47:13 fluffy kernel: igb0: link state changed to UP
...
Apr 11 06:47:28 fluffy routing: routing_start: Wed Apr 11 06:47:28 PDT 2018 _cmd static, _af any, _if igb0

Note that on my system /etc/init.d/network.igb0 is not a symlink to /etc/init.d/network if that matters.

Also, I couldn’t work out how routing adds the default route. static_inet() seems to get the correct value for ${defaultrouter}, but the script doesn’t seem to use it. The function does call ${ROUTE_CMD} for static routes, but nothing is done with the default route.


#30

Mounted the previous BE and the following files are different:

/etc/init.d/automount
/etc/init.d/automountd
/etc/init.d/autounmountd
/etc/init.d/bluetooth
/etc/init.d/jail
/etc/init.d/localmount
/etc/init.d/modules
/etc/init.d/moused
/etc/init.d/wpa_supplicant
/etc/init.d/ypbind

One change is the removal of /etc/init.d/net-online (i.e. existed in the previous BE but not in the current), but that may only be directly applicable to ypbind.

OK, I found it. The new stable image added the following to /etc/defaults/rc.conf:

@@ -786,6 +788,7 @@
 # This allows net.wlan and any service not matching net.* to be hotplugged.
 # Example - rc_hotplug="!net.*"
 # This allows services that do not match "net.*" to be hotplugged.
+rc_hotplug="network.* moused.* dhcpcd.* jail.* wpa_supplicant.*"
 
 # rc_logger launches a logging daemon to log the entire rc process to
 # /var/log/rc.log

Removing the rc_hotplug=... line allows the network to come up normally. Changing the depend function in /etc/init.d/routing to after net does not appear to be necessary. Can someone comment on this change?


#31

The commit which changed this is 77f905a - Cleanup of devd.conf and start using OpenRC’s rc.devd shim by @kris if that helps.


#32

Good work Chuck! I concur that fixes the problem for me, too. I even tried it with only:

 rc_hotplug="moused.*"

and it still broke the default route.

BTW, it had no effect on evolution having a segmentation fault, so that’s probably a separate matter.