Skip to content

Commit 41b3d94

Browse files
committed
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: freebsd/pkg#2128
1 parent 5841374 commit 41b3d94

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

scripts/packages/postinstall.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,10 @@ upgrade_config_file() {
274274
}
275275

276276
restart_agent_if_required() {
277+
if [ "${ID}" = "freebsd" ]; then
278+
# https://github.com/freebsd/pkg/pull/2128
279+
return
280+
fi
277281
if service nginx-agent status >/dev/null 2>&1; then
278282
printf "PostInstall: Restarting nginx agent\n"
279283
service nginx-agent restart || true

0 commit comments

Comments
 (0)