From f98c4dd4280cbbb7b335a3b40dc70810e77b43d2 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Sat, 8 Nov 2025 01:33:30 +1100 Subject: [PATCH] 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. --- rust/gateway/Cargo.toml | 2 +- rust/gateway/debian/postinst | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/rust/gateway/Cargo.toml b/rust/gateway/Cargo.toml index fbb75fcdf..dcd7c55eb 100644 --- a/rust/gateway/Cargo.toml +++ b/rust/gateway/Cargo.toml @@ -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 } diff --git a/rust/gateway/debian/postinst b/rust/gateway/debian/postinst index 661f7184a..421b116b2 100644 --- a/rust/gateway/debian/postinst +++ b/rust/gateway/debian/postinst @@ -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#