3 SDRangel server with supervisor in Arch Linux
f4exb edytuje tę stronę 2018-09-21 01:57:18 +02:00

Installation

Assumes user is f4exb, server address is 192.168.1.50 and SDRangel is installed in /opt/install/sdrangel

This was tested on Raspberry Pi 3B Arch Linux ARM aarch64

sudo pacman -Sy supervisor
cd /etc
sudo mv supervisord.conf supervisord.old

Replace /etc/supervisord.conf with this content:

; supervisor config file

[unix_http_server]
file=/var/run/supervisor.sock   ; (the path to the socket file)
chmod=0700                       ; sockef file mode (default 0700)

[supervisord]
user=root
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
childlogdir=/var/log/supervisor            ; ('AUTO' child log dir, default $TEMP)
logfile_maxbytes = 10MB
logfile_backups = 3
loglevel = info

[inet_http_server]
port = *:9001
;username = admin
;password = admin

[supervisorctl]
serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL  for a unix socket

; the below section must remain in the config file for RPC
; (supervisorctl/web interface) to work, additional interfaces may be
; added by defining them in separate rpcinterface: sections
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

; The [include] section can just contain the "files" setting.  This
; setting can list multiple files (separated by whitespace or
; newlines).  It can also contain wildcards.  The filenames are
; interpreted as relative to this file.  Included files *cannot*
; include files themselves.

[include]
files = /etc/supervisor.d/sdrangelsrv.conf

Create supervisor.d/sdrangelsrv.conf with this content

[program:sdrangelsrv]
command = /opt/install/sdrangel/bin/sdrangelsrv -a 192.168.1.48
process_name = sdrangelsrv
user = f4exb
stopsignal = INT
autostart = false
autorestart = false
environment =
    USER=f4exb,
    PATH="/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl",
    HOME="/home/f4exb"
redirect_stderr = true
stdout_logfile = /home/f4exb/log/sdrangelsrv.log
stdout_logfile_maxbytes = 10MB
stdout_logfile_backups = 3
loglevel = debug

Manage supervisor

sudo systemctl status supervisord
* supervisord.service - Process Monitoring and Control Daemon
   Loaded: loaded (/usr/lib/systemd/system/supervisord.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
     Docs: http://supervisord.org

/!\ before start: mkdir ~/log

sudo systemctl start supervisord
sudo systemctl stop supervisord
sudo systemctl restart supervisord

To have supervisord started at boot time: sudo systemctl enable supervisord

Web control

Web interface at http://192.168.1.50:9001

SDRangel API (default port) at http://192.168.1.50:8091

Control via command line

sudo supervisorctl status
sdrangelsrv                     STOPPED   Aug 22 06:35 AM

sudo supervisorctl start sdrangelsrv
sdrangelsrv: started

sudo supervisorctl stop sdrangelsrv
sdrangelsrv: stopped