Using rc.local to delay boot process

Hello all,

I have to delay the boot process of my Pi (OSMC version 2016.10-2 ) for other components in the network have to be ready first and are booting slower than the Pi.

My plan so far was simply adding a sleep to the rc.local to delay the boot for some amount of time:

#!/bin/sh -e 
# rc.local
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
# In order to enable or disable this script just change the execution 
# bits.
# By default this script does nothing.

echo "Delay boot ...."
sleep 120
echo "Continue booting ..."

exit 0

I think that the execution bits are set correctly:
-rwxr-xr-x 1 root root rc.local

But once the Pi boots, the script seems to be ignored as it quickly boots as normal without delay. Executing the rc.local manually works as expected.

What am I missing here? Thanks for any suggestions!

Have you seen the ‘wait for network’ option in MyOSMC+pi config?

Hi, thanks for the reply.

Yes I know about that option but it doesn’t help. The reason therefore is that I plan to use both, WiFi and Ethernet connections.
As Ethernet is much faster up than the WiFi, it connects to the Ethernet and won’t connect to the WiFi afterwards (maybe due to priority issues).

If both, Ethernet and WiFi are available when the Pi boots, both connections are perfectly established.

The system has already mostly booted before rc.local is executed.

If you want to delay the whole boot process add boot_delay=30 to /boot/config.txt

Change 30 to number of seconds you wish to delay by.