John Lauer Hi John,

@jlauer Hi John, I had to rebuild my raspberry pi and I forgot the settings that made the SPJS service run previously.

I’ve got the following script that will not start. I’ve followed your instructions but I’m missing some knowledge. Do you see anything wrong with this. I’ve created the serial-port-json-server file this file in the “/etc/init.d/”. The “/home/pi/Documents/spjs/spjs194/” is path to the serial-port-json-server script to run.

#! /bin/sh

BEGIN INIT INFO

Provides: serial-port-json-server

Required-Start: $all

Required-Stop:

Default-Start: 2 3 4 5

Default-Stop: 0 1 6

Short-Description: Manage my cool stuff

END INIT INFO

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin

. /lib/init/vars.sh
. /lib/lsb/init-functions

If you need to source some other scripts, do it here

case “$1” in
start)
log_begin_msg “Starting Serial Port JSON Server service”

do something

    /home/pi/Documents/spjs/spjs194/serial-port-json-server -regex usb|acm &
log_end_msg $?
exit 0
;;

stop)
log_begin_msg “Stopping the Serial Port JSON Server”

# do something to kill the service or cleanup or nothing
killall serial-port-json-server
log_end_msg $?
exit 0
;;

*)
echo “Usage: /etc/init.d/serial-port-json-server {start|stop}”
exit 1
;;
esac

Top problem is usually just getting the paths correct