Headless DIXPRS Operation

  1. Now we want DIXPRS to run in its own screen and run whenever the Raspberry Pi is started. You have to install a program called screen.

sudo apt-get install screen

cd /etc/init.d

sudo nano dixprs

copy the script below and write the dixprs file in /etc/init.d


#!/bin/sh

#/etc/init.d/dixprs

########################### BEGIN INIT INFO

# Provides: dixprs

# Required-Start: $remote_fs $syslog

# Required-Stop: $remote_fs $syslog

# Default-Start: 2 3 4 5

# Default-Stop: 0 1 6

# Short-Description: Simple script to start dixprs at boot

# Description: A simple script which will start/stop dixprs

########################### END INIT INFO

cd /usr/local/dixprs

case “$1” in

start) echo “Starting dixprs in a screen”

sudo screen -dmS dixprs /usr/local/dixprs/dixprs.py -c /usr/local/dixprs/config.txt

;;

stop) echo “Stopping dixprs screen”

sudo killall screen

;;

*)

echo “Usage: /etc/init.d/dixprs {start|stop}”

exit 1

;;

esac

exit 0

  1. Now change the file permissions and test the script

sudo chmod 755 dixprs

./dixprs start

*** DIXPRS 2.2.2 – 05-09-2012 – (pid=2957)
*** AIR0 process started [TNC-PI] (pid=2958))
*** IGATE process started [host=rotate.aprs2.net, port=14580] (pid=2959)
*** WEBSR process started [port=9999] (pid=2960)
*** Connection established

  1. Now to register the script to be run at startup and shutdown.

sudo update-rc.d dixprs defaults

That’s it all there is to it. dixprs will run at each time the Raspberry Pi is started or rebooted.

 

Click HERE to learn how to monitor DIXPRS operation