Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions packaging/common/cfengine-hub/preremove.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# Drain in-flight cf-agent before stopping the cfengine3 umbrella: otherwise
# a running cf-agent can re-trigger cf-php-fpm (which Wants=cf-postgres),
# leaving cf-postgres in a Restart=always loop while the package is gone.
if use_systemd; then
/bin/systemctl stop cf-execd.service >/dev/null 2>&1 || true
t=60
while [ $t -gt 0 ] && pgrep -x cf-agent >/dev/null 2>&1; do
sleep 1
t=$((t - 1))
done
pkill -KILL -x cf-agent >/dev/null 2>&1 || true
fi

cf_console platform_service cfengine3 stop
if use_systemd && [ -e /usr/lib/systemd/system/cfengine3-web.service ]; then
# When using systemd, the services are split in two, and although both will
Expand Down
Loading