fix(install): add early systemd detection to prevent mid-install failures

- Enhance `handle_systemd()` to check for `/run/systemd/system` and exit early if systemd is not PID 1, with user-friendly error messages.
- Update README.md notes for Devuan and SYSTEMD_MODE to reflect the new behavior and clarify requirements.
This commit is contained in:
Greg Gauthier 2026-05-03 15:45:55 +01:00
parent e6abf28252
commit 796c00fb03
2 changed files with 12 additions and 2 deletions

View File

@ -37,7 +37,7 @@ Other derivatives are detected automatically via the `ID_LIKE` field in `/etc/os
- Debian 13
- NOTE: The Debian project is no longer using a standard package name for `libasound2`. Not to worry, apt will automatically select the `libasound2t64` packages it needs. For all derivative distributions, therefore, the package name will remain "libasound2".
- Devuan 6.1 Excalibur
- NOTE: the server-mode installation will not work here, because Devuan does not support systemd)
- NOTE: server-mode installation is unavailable here, because Devuan does not use systemd. The installer detects this and refuses `SYSTEMD_MODE=install` up front rather than failing mid-install.
- Manjaro
- Fedora 44
- OpenMandriva 6
@ -60,7 +60,7 @@ The script will present the SDRPlay license agreement and prompt for acceptance
- `ACCEPTLICENSE=1` — Skip the interactive license prompt
- `DONOTDOWNLOAD=1` — Use local tarballs instead of downloading (place them in the current directory). Also skips the upstream lookup (build hashes and licence text); pin filenames with the override variables below
- `NOTSUPPORTED=1` — Skip dependency checks entirely (install them yourself)
- `SYSTEMD_MODE=install SYSTEMD_TARGET=sdrconnectserver` — Enable the server systemd service
- `SYSTEMD_MODE=install SYSTEMD_TARGET=sdrconnectserver` — Enable the server systemd service (requires systemd as PID 1; refuses to run otherwise)
- `SDRCONNECT_GITBUILD=<hash>` — Pin the SDRconnect build hash, bypassing the upstream lookup
- `RIGCONTROL_GITBUILD=<hash>` — Pin the RigControl build hash, bypassing the upstream lookup

View File

@ -584,6 +584,16 @@ handle_systemd() {
return
fi
# systemd creates /run/systemd/system when it is PID 1. Bail out early on
# non-systemd inits (Devuan, Artix-openrc/runit, Slackware, etc.) so we
# don't fail mid-install and trigger the rollback trap.
if [[ ! -d /run/systemd/system ]]; then
error "SYSTEMD_MODE=$mode requested, but systemd is not the active init on this system."
error "Re-run without SYSTEMD_MODE (or with SYSTEMD_MODE=skip) and configure the"
error "service manually using your distro's init system (sysvinit, openrc, runit, ...)."
exit 1
fi
# Only resolve target if we actually need it
local target="${SYSTEMD_TARGET:-}"