Rc.local does not work when starting raspberry pi

I'm trying to run simple C code when loading pi, so I followed the steps in the documentation ( https://www.raspberrypi.org/documentation/linux/usage/rc-local.md ), but when I run it, it shows this error :

Failed to start etc/rc.local compatibility.
See 'systemctl status rc-local.service' for details.

I do as he says, and I get the following:

rc-local.service - /etc/rc.local Compatibility
Loaded: loaded (/lib/systemd/system/rc-local.service; static)
Drop-In: /etc/systemd/system/rc-local.service.d
         ttyoutput.conf
Active: failed (Result: exit-code) since Tue 2015-12-08 10:44:23 UTC; 2min 18s ago
Process: 451 ExecStart=/etc/rc.local start (code=exit, status=203/EXEC)

My rc.local file looks like this:

./home/pi/server-starter &

exit 0

Can someone show me what I'm doing wrong?

+4
source share
2 answers

You must reference your script using the absolute path.

/home/pi/server-starter &

Note the absence .compared to your decision.

, rc.local.

#!/bin/sh -e
/home/pi/server-starter &
exit 0
+1

script " script" :

sh -c /absolute/path/to/script;

script :

sh -c /absolute/path/to/script &;

exit 0

0

Source: https://habr.com/ru/post/1619406/


All Articles