This document is a continuation of RPI4 Trifecta: VARA, Packet & ARDOP – One Audio Interface, BPQ32 Rig Control – VOX and/or CAT PTT, RPI4: VARA & Syslog
Application as a Service
Running VARA/ARDOP/QtSoundModem as independent system services is ideal as it can help towards automation. For instance, if a TNC crashes or you need to shut down quickly it helps to have these prepared and ready to take over the repetitive and annoying tasks.
Let systemd take care of it. My systemd script forks a ‘screen’ process to capture the console output for debug analysis at any time, and it forks via a script so that minor adjustments can be made without having to ‘systemctl daemon-reload’ all the time.
There are references to another system unit file ‘vvnc-modems.service’, this is another systemd service that launches a virtual VNC desktop, to which VARA and the other modems with GUIs are thrown to.
This makes monitoring the modems a breeze because I don’t have to keep them open on the main desktop all the time or if I do I can scale the window down with all of them in so that they are up in the top corner while I do other things.
Below, all of the systemd unit files and start scripts are fully illustrated, if you want to download them ready-to-go, here’s the ZIP archive, includes bonus wsjtx.service that will autostop all modems when manually started.
VARA Systemd Unit File
[Unit] Description=VARA Start Script by PE1RRR After=vvnc-modems.service Wants=vvnc-modems.service [Service] Type=forking WorkingDirectory=/home/pi/bin Restart=always RestartSec=15 StartLimitInterval=60 StartLimitBurst=3 User=pi Group=pi ExecStart=/usr/bin/screen -S VARA-Console -d -m /home/pi/bin/startvara ExecStop=/usr/local/bin/wineserver -k SyslogIdentifier=VARA-Debug [Install] WantedBy=multi-user.target
VARA Start Script
Virtual VNC Systemd Unit File
[Unit] Description=Shack Desktop Start Script by PE1RRR After=network.target [Service] Type=forking WorkingDirectory=/home/pi/bin Restart=always RestartSec=20 StartLimitInterval=60 StartLimitBurst=3 User=pi Group=pi ExecStart=/home/pi/bin/vvnc-modems SyslogIdentifier=Shack-VNC [Install] WantedBy=multi-user.target
Virtual VNC (re)Start Script
#!/bin/bash vncserver -kill :2 vncserver :2 -geometry 1080x764
Initiating Systemd scripts
sudo systemctl enable qtsm sudo systemctl enable vvnc-modems sudo systemctl enable ardop sudo systemctl enable ardop-gui sudo systemctl enable vara sudo service vara start (any of the modems will start the vvnc-modems virtual desktop service automatically)
I do this for all of the modems, so each one is a service and can be stopped independently, or by calling a script that just goes through the motions:
sudo service vara stop
sudo service qtsm stop
sudo service ardop stop
sudo service ardop-gui stop
sudo service vara start
sudo service qtsm start
sudo service ardop start
sudo service ardop-gui start