Configurarea serviciului Svxlink

De la YO3ITI
Salt la: navigare, căutare

Configurare serviciu

cd /lib/systemd/system
sudo nano svxlink.service

Mare atenție la parametrii de pornire:

[Service]
EnvironmentFile=/opt/rolink/default/svxlink
PIDFile=${PIDFILE}
ExecStartPre=-/bin/touch ${LOGFILE}
ExecStartPre=-/bin/chown ${RUNASUSER} ${LOGFILE}
ExecStart=/opt/rolink/bin/svxlink --logfile=${LOGFILE} --config=${CFGFILE} --pidfile=${PIDFILE} --runasuser=${$
ExecReload=/bin/kill -s HUP $MAINPID
Restart=on-failure
TimeoutStartSec=60
TimeoutStopSec=10
#WatchdogSec=
#NotifyAccess=main
LimitCORE=infinity
WorkingDirectory=/opt/rolink/svxlink

Mare atenție la configurarea log-ului; serviciul nu poate porni fără o cale către un log valid:

sudo nano /opt/rolink/default/svxlink
#############################################################################
#
# Configuration file for the SvxLink Systemd unit file
#
#############################################################################

# The user to run the SvxLink server as
RUNASUSER=svxlink

# Specify which configuration file to use
CFGFILE=/opt/rolink/svxlink/svxlink.conf

# Where to place the log file
LOGFILE=/opt/rolink/var/log/svxlink.log

# Where to place the PID file
PIDFILE=/run/svxlink.pid

# Disable Alsa zerofill if set to 0 (see manual page)
#ASYNC_AUDIO_ALSA_ZEROFILL=1

Configurarea pentru pornirea automată

După ce au fost parcurși cu success toți pașii de mai sus, se activează pornirea automată a serviciului odată cu pornirea sistemului:

sudo systemctl enable application.service

În cazul în care totul este ok, sistemul răspunde cu:

Created symlink /etc/systemd/system/multi-user.target.wants/svxlink.service → /lib/systemd/system/svxlink.service.

Verificarea cu sudo systemctl status svxlink generează următorul mesaj de succes:

tom@raspberrypi:~ $ svxstatus
● svxlink.service - SvxLink repeater control software
   Loaded: loaded (/lib/systemd/system/svxlink.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2020-07-19 11:47:22 EEST; 1min 22s ago
     Docs: man:svxlink(1)
  Process: 471 ExecStartPre=/bin/touch ${LOGFILE} (code=exited, status=0/SUCCESS)
  Process: 484 ExecStartPre=/bin/chown ${RUNASUSER} ${LOGFILE} (code=exited, status=0/SUCCESS)
 Main PID: 488 (svxlink)
    Tasks: 1 (limit: 4915)
   Memory: 12.8M
   CGroup: /system.slice/svxlink.service
           └─488 /opt/rolink/bin/svxlink --logfile=/opt/rolink/var/log/svxlink.log --config=/opt/rolink/svxlink/svxlink.conf --pidfile=/ru

Jul 19 11:47:22 raspberrypi systemd[1]: Starting SvxLink repeater control software...
Jul 19 11:47:22 raspberrypi systemd[1]: Started SvxLink repeater control software.

Erori în log-uri

Apr 17 14:09:13 raspberrypi svxlink[970]: Libgcrypt warning: missing initialization - please fix the application

Link-uri externe