Minimal, batteries‑included unit that starts both supysonic-daemon and supysonic-server together, manages a runtime socket under /run, and cleans the socket on stop/shutdown. Designed and tested for Ubuntu 24.04.2 LTS.
supysonic@.service— a template systemd unit. Run as any user via instance name (defaults below tosupysonic)..supysonic— a minimal~supysonic/.supysonicconfiguration. (If you instead keep configs in~/.config/supysonic, that also works; this unit does not force a location.)
Note: Ensure your daemon/server configs agree on the same socket path. The unit expects
/run/supysonic-<user>/socket. Set this in your Supysonic config (daemon section).
# 1) Copy the unit into place
sudo install -m 0644 supysonic@.service /etc/systemd/system/supysonic@.service
# 2) (Optional) Place your minimal config under the actual user's home
# If your config lives at ~supysonic/.supysonic, create it there now.
# Example (you will supply real files):
# sudo -u supysonic install -d -m 0755 ~supysonic/.supysonic
# 3) Reload systemd and enable the unit for user 'supysonic'
sudo systemctl daemon-reload
sudo systemctl enable --now supysonic@supysonic.service
# 4) Verify
systemctl status --no-pager supysonic@supysonic.service
journalctl -u supysonic@supysonic.service -n 100 --no-pager- Runs both processes in one unit; if either exits, the other is terminated and the unit stops.
- Socket path is under
/run/supysonic-<user>/socketviaRuntimeDirectory. Stale sockets are removed on start and stop. - User/group, home, and runtime dir are derived from the instance:
supysonic@<user>.service.
- Run as another user (e.g.,
media):sudo systemctl enable --now supysonic@media.service - If you prefer TCP for the web server, keep your existing
host/portin Supysonic’s server config; the unit doesn’t override those. - If your media library sits outside the user’s home, you may relax hardening by setting
ProtectSystem=read-onlyorfalseas needed.
sudo systemctl disable --now supysonic@supysonic.service
sudo rm -f /etc/systemd/system/supysonic@.service
sudo systemctl daemon-reloadThe stock supysonic-daemon.service only runs the daemon and can leave a stale Unix socket after crashes. This unit consolidates lifecycle control (daemon + server), relocates the socket to /run for automatic cleanup on restart/reboot, and provides a user‑parameterized instance for clean multi‑user setups on Ubuntu 24.04.2 LTS.