g8gkq
Posts: 28
Joined: Thu Mar 30, 2017 10:25 am
Location: Southampton

Reduce no-network boot time?

Mon Apr 10, 2017 4:55 pm

I am using Raspbian Jessie Lite 2016-11-29 (with a regular dist-upgrade) on a some portable RPi 3s with touchscreens. Sometimes they are connected to a wired LAN, sometimes they are connected to a wireless LAN and sometimes there is no network available. They do not need network to function normally (as Digital Amateur Television Transmitters), but need it for remote control, configuration and update on a regular basis. https://github.com/BritishAmateurTelevisionClub/rpidatv

If connected to a network, they boot to touchscreen in about 15 seconds; however, if there is no network available they take an additional 25 seconds to boot.

Is there any way that I can reduce the no-network time-out to 5 or 10 seconds, rather than 25 - 30?

I have tried a number of suggestions in the /etc/systemd/system area without success so far. Grateful for any suggestions or pointers to existing posts that deal with the issue - the search terms aren't much help here!

Dave

User avatar
DougieLawson
Posts: 38883
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Reduce no-network boot time?

Mon Apr 10, 2017 6:18 pm

Take the auto and allow hotplug lines out of /etc/network/interfaces so it ends up looking like

Code: Select all

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

# DON'T REMOVE auto lo BAD THINGS WILL HAPPEN
auto lo
iface lo inet loopback

iface eth0 inet manual

#allow-hotplug wlan0
iface wlan0 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

#allow-hotplug wlan1
iface wlan1 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

g8gkq
Posts: 28
Joined: Thu Mar 30, 2017 10:25 am
Location: Southampton

Re: Reduce no-network boot time?

Mon Apr 10, 2017 8:41 pm

Thanks Dougie

I have just tried your suggestion, but it didn't seem to work. The final 3 lines of dmesg seem to show that it is waiting for the network:

Code: Select all

[    9.941745] Bluetooth: BNEP socket layer initialized
[   49.755942] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   49.756980] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
With the wired network connected these are the same lines

Code: Select all

[    5.560514] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[    5.600547] brcmfmac: brcmf_add_if: ERROR: netdev:wlan0 already exists
[    5.600562] brcmfmac: brcmf_add_if: ignore IF event
[    5.604791] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[    5.604810] brcmfmac: power management disabled
[    7.291566] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[    7.292224] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
I am using /etc/systemd/system/getty.target.wants/getty@tty1.service to start the touchscreen as I want the RPi to be able to operate totally headless.

Thanks, Dave

User avatar
DougieLawson
Posts: 38883
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Reduce no-network boot time?

Mon Apr 10, 2017 9:34 pm

Then there's some other process getting the network active.

Get rid of raspberrypi-net-mods if that package is installed.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

IanS
Posts: 250
Joined: Wed Jun 20, 2012 2:51 pm
Location: Southampton, England

Re: Reduce no-network boot time?

Tue Apr 11, 2017 9:07 am

You can also limit the timeout period that the boot process will try to establish a network link for. See http://unix.stackexchange.com/questions ... -systemctl for a couple of places there may already be a limit set.
On the RPis where I use this, I have put the timeout value in /etc/systemd/system/networking.service.d/reduce-timeout.conf

Code: Select all

[Service]
TimeoutStartSec=30

g8gkq
Posts: 28
Joined: Thu Mar 30, 2017 10:25 am
Location: Southampton

Re: Reduce no-network boot time?

Wed Apr 12, 2017 5:04 pm

Thanks to Dougie and Ian for their help.

I found the answer by looking at the output from

Code: Select all

less /var/log/syslog
and found that, with no network, dhcpcd was waiting for its default timeout period of 30 seconds and stalling everything.

I reduced this by appending

Code: Select all

# shorten timeout
timeout 15
to /etc/dhcpcd.conf, and now my no-network boot time is reduced by 15 seconds. I'm sure that I could reduce it further, but am worried about how it might behave on some of the slower networks.

Issue solved! Thanks again.

Dave

Return to “Advanced users”