Question My script on startup has running issues

ajaz1986

Reputable
Oct 30, 2018
45
0
4,540
I've got this script (https://github.com/Kasmetski/auto-hard-reset) to run on boot up but I've noticed it only starts running when I ssh in to check it.
I boot up the pi... waiting 5-10mins and nothing happens, so I ssh in and then it will start the script up automatically, only once I've ssh'd in.

Any ideas how to fix this so it will start regardless of whether I ssh in?
 
It's not actually me setting it up, it's a friend of mine since I don't have much experience with linux. I asked him to set it up so that the script will run on bootup, so incase of a power loss, when it powers back up, it can continue with the script running.

He said it was done, so I ssh'd in and I could see it running, which was great but then, I noticed when I close the ssh connection, the script is not running. I know how to keep an ssh window live but that won't work the way I want.

Is there a particular method or a place we need to put the script for it to run on startup? The Pi won't have any display unit connected, no mouse/keyboard, just an internet connection and remote access.
 
There are many ways to do it - create a system service, put it into /etc/init.d, or into /etc/rcS, that's why I'm asking which way your friend did it for you.

Hi okay I logged in today and can confirm the following ways I tried:

Added to rc.local = no effect
Added to crontab = no effect
Added to .bashrc = works but only if I make an ssh connection into the pi.

The pi is not connected to a display output, so I add to .bashrc and sudo reboot... i wait 4-5 minutes and nothing happens, then i ssh in and it starts running magically.


Sent from my iPhone using Tapatalk