fix(gateway): declare hard-dependency on systemd (#10803)

Several aspects of the Gateway's Debian package depend on `systemd`
being present. Without it, we don't have the necessary users and files
in place for the Gateway to function. With that specified, we can fail
the `postinst` script (and therefore the installation) if anything in
there goes wrong.
This commit is contained in:
Thomas Eizinger
2025-11-08 01:33:30 +11:00
committed by GitHub
parent 839cc4b7b3
commit f98c4dd428
2 changed files with 4 additions and 9 deletions

View File

@@ -21,7 +21,7 @@ assets = [
["debian/firezone-gateway.sysusers", "usr/lib/sysusers.d/firezone-gateway.conf", "644"],
["debian/firezone-gateway.tmpfiles", "usr/lib/tmpfiles.d/firezone-gateway.conf", "644"],
]
depends = 'iptables'
depends = 'iptables,systemd'
[dependencies]
anyhow = { workspace = true }

View File

@@ -1,13 +1,8 @@
#!/usr/bin/env bash
# Script inspired by deb helper script from `cargo-deb`
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ]; then
# In case this system is running systemd, we need to ensure that all
# necessary users are created before starting.
if [ -d /run/systemd/system ]; then
systemd-sysusers firezone-gateway.conf >/dev/null || true
fi
fi
set -e
systemd-sysusers firezone-gateway.conf
#DEBHELPER#