Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8621

Raspberry Pi OS • Re: etc/rc.local does not exist

$
0
0
sh is dash on Debian and Debian-derived Linux distros.

That is well known.

It is traditional to leave it as /bin/sh, and then limit yourself to using only Posix shell constructs, but, really, nothing bad would happen if you switched it to /bin/bash.

Also, you might as well remove the "-e" - there's really no good reason for it, and it can cause newbie-error-syndrome.

Arguably tradition is a good reason for keeping it but the truth of the matter is that you should be switching to systemd services and not using rc.local

It's also useful when you have a series of commands where each needs to have succeeded before the next is run. Otherwise you're into testing return codes or a very long line of the form command a && command b && command c [...]

And given how late it runs in the boot sequence you could probably use any scripting language (subject to an appropriate shebang) or a compiled binary and it would still work.

Statistics: Posted by thagrol — Sat Feb 15, 2025 11:32 pm



Viewing all articles
Browse latest Browse all 8621

Trending Articles