Start processes on boot with /etc/rc.local

Hello all,

I want to start SuperCollider on boot on a headless Pi 4 running Patchbox.
SuperCollider is running fine, and I edited /etc/rc.local adding “/usr/bin/scide” before “exit 0” in the rc.local file.

I did run “chmod +x /etc/rc.local”.

If I simply run /etc/rc.local from a terminal, it does what i want it to do (start SuperCollider), but NOT when it boots.

Any clues?

Hey, the reason for it working different is likely different user under which it runs and different environment variables available at the time it’s automatically executed. A desktop GUI availability may be playing a role too.

I haven’t used /etc/rc.local for startup tasks, I’d recommend using systemd services for background tasks and XDG autostart if it should run with a GUI.

There was some neat script on GitHub somewhere that could basically set up your script to run in a number of different automatic startup mechanism, but I couldn’t locate it quickly… I think it was called “runonboot” or somehow similarly.

1 Like

Thanks. My goal was ultimately to be able to completely shutdown the Pi every night and then wake it up via crontab/rtcwake but, if i got it right, that’s not actually possible cause the Pi never really shuts off unless power is cut off, right? Or would this GitHub script accomplish that?

Yes, the Pi’s power options are limited without any external additions like some relay switch. Once it’s shut down, the power must be cut off and reapplied for it to boot again.

The Pi 4 version seems to have some ‘wake on gpio’ configuration which might make it resettable via external GPIOs somehow, but doing a quick search didn’t provide any good guides, but it’d be something to look into.