Okay, a couple things. sono.sh
is your script that starts your process. ~
is the shortcut to the pi user’s home directory, also known as /home/pi
. In order to run scripts from the command line, you have to precede the script name with ./
So let’s take a moment to verify the state of your pi. Change to the home directory and pull up the file list with a couple switches to see if sonos.sh
exits:
pi@raspi:~ $ cd ~
pi@raspi:~ $ ls -lh sonos.sh
-rwxr-xr-x 1 pi pi 26 April 15 11:50 sonos.sh
There will be some variation in your results. If you see the phrase “No such file or directory”, then the file does not exist at that location. Also, you may not have any “x” entries when you do see the file listed. If so, the file is not marked executable, so it won’t run. You can fix this by typing chmod +x sonos.sh
I’m a little unclear as to what commands exactly are in your sonos.sh
file. Could you please enter cat sonos.sh
and reply with the results?
Adding the script to pm2 is done by typing pm2 start sonos.sh
. You can then verify that pm2 has picked it up by typing pm2 status all
. That will give you a list of the processes that pm2 is controlling. You should see both your mm.sh
process and your sonos.sh
process.
Give that a go and report back to us.