I am trying to diagnose why /etc/rc.local is not successfully executing on boot of a raspberry pi.
I have stripped the content of /etc/rc.local to a minimal version, and still cannot get it to touch a file in the /tmp directory.
I am getting this relevant output in /var/log/syslog on startup.
So looks like systemd is responsible for executing /etc/rc.local but is failing.
Have done lots of googling, no luck yet.
System info (new to raspberry pi so let me know what else i can post):
Linux raspberrypi 4.14.79-v7+ #1159 SMP Sun Nov 4 17:50:20 GMT 2018 armv7l GNU/Linux
#!/bin/bash # # 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. # Print the IP address touch /tmp/foo exit 0
raspberrypi systemd: Starting /etc/rc.local Compatibility... raspberrypi systemd: rc-local.service: Failed at step STDOUT spawning /etc/rc.local: No such device raspberrypi systemd: rc-local.service: Control process exited, code=exited status=209 raspberrypi systemd: Failed to start /etc/rc.local Compatibility. raspberrypi systemd: rc-local.service: Unit entered failed state. raspberrypi systemd: rc-local.service: Failed with result 'exit-code'
/etc/rc.local appears to have correct permissions:
pi@raspberrypi:~ $ ls -la /etc/rc.local -rwxr-xr-x 1 root root 345 Jan 16 18:03 /etc/rc.local
I ended up abandoning attempts to start my server via
/etc/rc.local and instead created a systemd unit, which was pretty straight forward.