The cause of this is that due to the parallel nature of systemd. So the commands in /etc/rc.local were being executed before the required hardware was setup.
To fix this problem it is necessary to create a systemd unit file that runs when the system becomes idle (i.e. after the boot process has completed.)
To do this:
create the following file:
/lib/systemd/system/myscript.service
and put the following lines into it:
Code: Select all
Description=My Script Service
After=multi-user.target
[Service]
Type=idle
ExecStart=/bin/bash /root/startup.sh
[Install]
WantedBy=multi-user.target
Code: Select all
chmod 644 /lib/systemd/systemmyscript.serviceCode: Select all
systemctl daemon-reload
systemctl enable myscript.service/root/startup.sh
and add the commands that you normally add to /etc/rc.local. Then reboot and your commands should be executed as expected.
This was shamelessly stolen from this article :
http://www.raspberrypi-spy.co.uk/2015/1 ... g-systemd/
Cheers, Ian