I'm trying to get a .sh script to run on system start-up. I've tried it several ways that don't work. The closest I got was using adding a line to /home/pi/bashrc
sh /home/pi/Desktop/run.sh &
This little script just starts up feh with a few parameters and restarts feh in case it crashes (which it does all the time but that's another issue).
The above runs run.sh
but only under root and in the background. I can see that in the task manager.
What do I need to do to run run.sh under the pi user account and in the foreground? I'm puzzled.
.bashrc
this way, it will come back to bite you. It isn't run specifically at system boot, it's run "When an interactive shell that is not a login shell is started" (man bash
), which may (or may not) happen at boot, but is likely to include other events as well.