possible to run a script in the background through SSH?

I need to start a python script remotely through SSH without rebooting the arduino yun (because apparently mine doesn't start up completely after a 'reboot' command through ssh or luci). seeing as how linino doesn't have 'nohup' or 'screen' is there another way to run a script through SSH and close my terminal?

p.s. I can connect and run a python script through SSH just fine, I just want to run it in the background on linino and remove the need to keep my ssh terminal open. since it terminates the script once I disconnect (even with & at the end)

KUM4:
without rebooting the arduino yun (because apparently mine doesn't start up completely after a 'reboot' command through ssh or luci).

I don't really have an answer to your question, but if you are having reboot stability issues, it might help to read this: How to improve reboot/reset stability. It includes an explanation of the some of the reboot issues, and solutions to help solve them. Usually, it's caused by your sketch sending data to the Linux processor while it is booting, and that causes the boot process to stop at one of two places where you can "hit any key to interrupt booting."

In my case, the ultimate solution was to cause any reboot of Linux to also reboot the AVR MCU. That restarts the sketch, which does a short fixed delay, then monitors pin 7 to wait for it to go low. When Linux is booted, it runs rc.local, and in there I turn on the handshaking GPIO which causes shield pin 7 to go low. At that point, the sketch knows that Linux is fully booted, and only then does it proceed to initialize the Bridge and start communications. I start to describe the process in this post, and offer some improvements in later posts.

While it doesn't answer your specific question, I do have one suggestion to offer that might solve the root problem. If the script you want to start (and leave running) is one needed by your sketch, I've had good success using a Process object to start the script in setup() and run it asynchronously. That way, the script is started whenever the sketch starts, so it is always available.

KUM4:
I need to start a python script remotely through SSH without rebooting the arduino yun (because apparently mine doesn't start up completely after a 'reboot' command through ssh or luci). seeing as how linino doesn't have 'nohup' or 'screen' is there another way to run a script through SSH and close my terminal?
...

opkg update
opkg install coreutils-nohup

Make "freerun.py" running even after detaching from console, to be more service like, you could use the trick

/usr/bin/nohup /root/freerun.py &

ShapeShifter:
I don't really have an answer to your question, but if you are having reboot stability issues, it might help to read this: How to improve reboot/reset stability. It includes an explanation of the some of the reboot issues, and solutions to help solve them. Usually, it's caused by your sketch sending data to the Linux processor while it is booting, and that causes the boot process to stop at one of two places where you can "hit any key to interrupt booting."

In my case, the ultimate solution was to cause any reboot of Linux to also reboot the AVR MCU. That restarts the sketch, which does a short fixed delay, then monitors pin 7 to wait for it to go low. When Linux is booted, it runs rc.local, and in there I turn on the handshaking GPIO which causes shield pin 7 to go low. At that point, the sketch knows that Linux is fully booted, and only then does it proceed to initialize the Bridge and start communications. I start to describe the process in this post, and offer some improvements in later posts.

While it doesn't answer your specific question, I do have one suggestion to offer that might solve the root problem. If the script you want to start (and leave running) is one needed by your sketch, I've had good success using a Process object to start the script in setup() and run it asynchronously. That way, the script is started whenever the sketch starts, so it is always available.

Will give these a go, thanks.

sonnyyu:

opkg update

opkg install coreutils-nohup




Make "freerun.py" running even after detaching from console, to be more service like, you could use the trick



/usr/bin/nohup /root/freerun.py &

Worked like a charm! Thank you :slight_smile: