From 6b863978f113aaae5f6f1fe4438ceccb5ebf87d0 Mon Sep 17 00:00:00 2001 From: Andrei Belov Date: Tue, 20 Jun 2023 16:57:36 +0400 Subject: [PATCH] Avoid restarting nginx-agent service from pkg on FreeBSD during upgrades This will end up with a new process being killed immediately by pkg: https://github.com/freebsd/pkg/blob/1.19.1/libpkg/scripts.c#L100-L103 https://github.com/freebsd/pkg/blob/1.19.1/libpkg/scripts.c#L244-L261 See also: https://github.com/freebsd/pkg/pull/2128 --- scripts/packages/postinstall.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/packages/postinstall.sh b/scripts/packages/postinstall.sh index 5b64a7cda4..46919c7d3d 100755 --- a/scripts/packages/postinstall.sh +++ b/scripts/packages/postinstall.sh @@ -274,6 +274,10 @@ upgrade_config_file() { } restart_agent_if_required() { + if [ "${ID}" = "freebsd" ]; then + # https://github.com/freebsd/pkg/pull/2128 + return + fi if service nginx-agent status >/dev/null 2>&1; then printf "PostInstall: Restarting nginx agent\n" service nginx-agent restart || true