I just setup my Pi2 to run the SPJS server on boot by placing a script in inet.d. It boots and runs the SPJS console just fine, but it completely takes over the pi and won’t let me break out of it or get to a login prompt anymore. How do I terminate the SPJS script so that it will continue to my login prompt if I needed to get to the console?
Not sure how spjs could ever take over a Linux box. You could try to hit the restart button on chilipeppr however. I suspect something else is really wrong.
You can send the word “exit” to it from ChiliPeppr and it will exit the process. You can only do this word from the low-level console in the “Serial Port JSON Server” widget by revealing the console in the upper-right pulldown menu. You can also do this from the serialport workspace.
However, I too am skeptical that SPJS is taking over your Raspi. You sure it isn’t something else? I run my SPJS the way you describe on 3 different embedded machines from an init.d and they all work really well.
I just connected via ssh and deleted the script that called the spjs. Rebooted and it took me right to the login prompt as i’d expect. Unless I’m doing something wrong with my shell script. It’s just a simple bash script with a call directly to ~/home/pi/spjs/serial-port-json-server
I couldn’t even use any of the other consoles (ctrl+alt+F key) they were all blank.
Is the script in inet.d script set to daemonize spjs, or is it waiting for spjs to “exit” to resume startup?
I suspect you need to add an & to the end of the line starting spjs.
spjs was running fine that way and I could connect to it with chilipeppr from my laptop but it’s like it ran the script and then was waiting for something that it wasn’t receiving.
That may be it. It was just 2 lines in the script. The /bin/sh and the call to the script. I’ll try it with an & at the end. I’m a c# guy. bash scripting isn’t my forte
that was it. Adding & to kick it to the background was needed. Thanks @Rob_Giseburt !
NP, @Carl_Fisher . That’s the sort of stuff I do all day long.
ahh i see. it was blocking. Didn’t think of that.