Let the client wait for an enabled local server without activating a disabled one, and declare the socket families required by both services for configured listeners and remote connections. Assisted-By: OpenAI Codex (GPT-5) Signed-off-by: Stan Grams <sjg@haxx.space>
42 lines
1.6 KiB
Desktop File
42 lines
1.6 KiB
Desktop File
# SPDX-FileCopyrightText: 2026 Stan Grams <sjg@haxx.space>
|
|
#
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
#
|
|
# systemd *user* unit for the trx-rs radio server.
|
|
#
|
|
# Install with `script/install.sh` (which substitutes @BINDIR@ and copies this
|
|
# into ~/.config/systemd/user/), or by hand:
|
|
# sed 's|@BINDIR@|/usr/local/bin|' trx-server.service \
|
|
# > ~/.config/systemd/user/trx-server.service
|
|
# systemctl --user daemon-reload
|
|
# systemctl --user enable --now trx-server.service
|
|
#
|
|
# Reads the combined config at ~/.config/trx-rs/trx-rs.toml ([trx-server]
|
|
# section). Serial (/dev/ttyUSB*) and audio access require your user to be in
|
|
# the `dialout` and `audio` groups — a user unit cannot grant them itself.
|
|
|
|
[Unit]
|
|
Description=trx-rs radio server (CAT/SDR backend)
|
|
Documentation=https://github.com/stanislawgrams/trx-rs
|
|
# The server binds its control/audio TCP listeners and may connect to networked
|
|
# rigs and reporting services, so do not start it before networking is ready.
|
|
Wants=network-online.target
|
|
After=network-online.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
ExecStart=@BINDIR@/trx-server --config %h/.config/trx-rs/trx-rs.toml
|
|
Restart=on-failure
|
|
RestartSec=2
|
|
# Both binaries shut down cleanly on SIGINT (the server drains audio and exits
|
|
# 0); systemd's default SIGTERM is not handled, so signal SIGINT instead.
|
|
KillSignal=SIGINT
|
|
TimeoutStopSec=15
|
|
NoNewPrivileges=true
|
|
# Permit local IPC plus IPv4/IPv6 listening and outbound connections. Ports
|
|
# are configuration-defined, so SocketBindAllow= cannot safely narrow them.
|
|
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
|
|
|
|
[Install]
|
|
WantedBy=default.target
|