From 9aa60b747e47899a0331ed631438da13e00cacac Mon Sep 17 00:00:00 2001 From: Jamil Date: Tue, 18 Mar 2025 13:31:53 -0700 Subject: [PATCH] fix(gateway): Fix gateway install script for systemd 219 (#8480) On older systemd versions (such as 219 bundled with Amazon Linux 2), the `ExecStartPre` script isn't able to write to the `/usr/local/bin` directory. This causes an error on unit startup. To fix this, we update the `firezone-gateway-init` script to write to `/opt/firezone` instead, which is `chown` `firezone:firezone`. Tested to work on Amazon Linux 2. Fixes #8471 --- scripts/gateway-systemd-install.sh | 31 +++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/scripts/gateway-systemd-install.sh b/scripts/gateway-systemd-install.sh index 50b18d127..8dbd3cdc9 100755 --- a/scripts/gateway-systemd-install.sh +++ b/scripts/gateway-systemd-install.sh @@ -64,7 +64,7 @@ Environment="OTLP_GRPC_ENDPOINT=$FIREZONE_OTLP_GRPC_ENDPOINT" ExecStartPre=/usr/local/bin/firezone-gateway-init # ExecStart script -ExecStart=/usr/local/bin/firezone-gateway +ExecStart=/opt/firezone/bin/firezone-gateway # Restart on failure TimeoutStartSec=3s @@ -126,29 +126,42 @@ cat < /dev/null 2>&1 || iptables -A FORWARD -i tun-firezone -j ACCEPT