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:
parent
e6abf28252
commit
796c00fb03
@ -37,7 +37,7 @@ Other derivatives are detected automatically via the `ID_LIKE` field in `/etc/os
|
|||||||
- Debian 13
|
- 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".
|
- 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
|
- 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
|
- Manjaro
|
||||||
- Fedora 44
|
- Fedora 44
|
||||||
- OpenMandriva 6
|
- 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
|
- `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
|
- `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)
|
- `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
|
- `SDRCONNECT_GITBUILD=<hash>` — Pin the SDRconnect build hash, bypassing the upstream lookup
|
||||||
- `RIGCONTROL_GITBUILD=<hash>` — Pin the RigControl build hash, bypassing the upstream lookup
|
- `RIGCONTROL_GITBUILD=<hash>` — Pin the RigControl build hash, bypassing the upstream lookup
|
||||||
|
|
||||||
|
|||||||
@ -584,6 +584,16 @@ handle_systemd() {
|
|||||||
return
|
return
|
||||||
fi
|
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
|
# Only resolve target if we actually need it
|
||||||
local target="${SYSTEMD_TARGET:-}"
|
local target="${SYSTEMD_TARGET:-}"
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user