I want to run some script at bootup, right now I'm trying to see if can achieve this using rc.local is this even a good practice??
To try out this script that it's supposed to run at bootup I'm am trying to run it just with the default code that comes within the scriptThe one that prints the IP address). The problem is that when I run this script manually it works perfectly even if I put some other scripts and I run this one everything seems okay the problem is at bootup it doesn't work.
I'm trying to fix this and after two days of research I've learned some things if reboot the pi and run :
sudo systemctl status rc-local
there are errors and the console displays that the operation has failed in red letters because of some compatibility error. Is there a problem with the OS? I'm using the latest version of raspian (STRECH).
rc-local.service - /etc/rc.local Compatibility
Loaded: loaded (/lib/systemd/system/rc-local.service; static)
Active: failed (Result: exit-code) since Mon 2016-01-25 18:16:55 CET; 3min 49s ago
Process: 378 ExecStart=/etc/rc.local start (code=exited, status=203/EXEC)
Jan 25 18:16:55 pocketvj-100 systemd[1]: rc-local.service: control process exited, code=exited status=203
Jan 25 18:16:55 pocketvj-100 systemd[1]: Failed to start /etc/rc.local Compatibility.
Jan 25 18:16:55 pocketvj-100 systemd[1]: Unit rc-local.service entered failed state.
Also, I got the warning that suggests us to run:
sudo systemctl daemon-reload
so I did it and it didn't work out for me.
I also verified if this script was even executable and it was, using
ls -l
I got this:
-rwxr-xr-x
and as far as I know, this is okay.
- Is this compatibility error possible to fix?
- rc.local good practice?
- Should I better try systemd workaround or crontab?
- what are the best practices?
sudo
which is proper, but inrc.local
you don't wantsudo
– SDsolar Jul 09 '18 at 22:22