Hi CentralWare
... LOL - and sixty seconds for a network timeout is an eternity! Except on dial-up and some old forms of single channel DSL! Or... "Hang on, maw! I'm adjusting the satellite dish!"
If you look at settime.sh in isolation, that might be true.
Examined in context, 60 seconds might not be such a bad choice.
Looking in tc-config we find this:
[ -z "$DHCP_RAN" ] && /etc/init.d/dhcp.sh &
[ -z "$NORTC" ] || /etc/init.d/settime.sh &
Both dhcp and settime are launched into the background at the
same time. So right off the bat we are waiting for dhcp to finish.
dhcp starts with this:
/sbin/udevadm settle --timeout=5
So it could wait for up to 5 seconds for udev.
Then, for each interface it finds, it executes this:
/sbin/udhcpc -b -i $DEVICE -x hostname:$(/bin/hostname) -p /var/run/udhcpc.$DEVICE.pid >/dev/null 2>&1 &
This command has been backgrounded. That may speed things up
since DHCP requests for multiple device will be sent out back to back.
Not being familiar with udhcpc , I ask for some help. The following
options stood out to me, since they were not specified in the
original command:
tc@E310:~$ udhcpc --help
BusyBox v1.29.3 (2018-12-19 15:29:37 UTC) multi-call binary.
----- Snip -----
-t N Send up to N discover packets (default 3)
-T SEC Pause between packets (default 3)
-A SEC Wait if lease is not obtained (default 20)
----- Snip -----
If I am reading that correctly, in the worst case this would happen:
Time Action
00 Send DHCP request
20 Wait 20 Secs for response
23 Pause for 3 Seconds
23 Send DHCP request
43 Wait 20 Secs for response
46 Pause for 3 Seconds
46 Send DHCP request
66 Wait 20 Secs for response
And if udev takes the full 5 Secs that's 71 Secs.
To me, this looks like hoping for the best (usual outcome), and
trying to plan for the worst (corner cases).
Since the timeout terminates once the interface is detected, faster
systems won't be impacted by a 60 Sec timeout.