I'm running this on a Raspberry Pi I'm using as an AIS receiver. I have followed the documentation but cannot get Kplex to run on start up.
I've tried this:
Created a file called aisstart.sh in /home/pi
Inside the file it says
sudo service kplex start
sudo kplex file:direction=out
Then
chmod -755 /home/pi/aisstart.sh
And added it to rc.local with and without bash
bash /home/pi/aisstart.sh &
#!/bin/sh -e
## rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
# By default this script does nothing.
exit 0
I can run the script and rc.local manually but it will not run at start up.
When that didn't work I removed it from rc.local and added it as a cron job using:
@reboot sleep 10 cd/home/pi && /bin/bash aisstart.sh
With and without the sleep.
Is there something simple I am missing or a better way?