Fix Void package lifecycle on host
This commit is contained in:
+16
-20
@@ -1,33 +1,29 @@
|
||||
#!/bin/sh
|
||||
# XBPS REMOVE script — pre-remove and purge paths.
|
||||
# XBPS REMOVE script — pre-remove path.
|
||||
#
|
||||
# Arguments: $1=ACTION $2=PKGNAME $3=VERSION $4=UPDATE $5=CONF_FILE $6=ARCH
|
||||
#
|
||||
# Actions: pre (before files removed), post (after files removed),
|
||||
# purge (after metadata removed, for config cleanup)
|
||||
# Actions: pre (before files removed)
|
||||
set -eu
|
||||
|
||||
ACTION="$1"
|
||||
|
||||
UPDATE="$4"
|
||||
case "${ACTION}" in
|
||||
pre)
|
||||
# Sanctioned disable — close monitoring period
|
||||
if [ -x /usr/libexec/fenris/fenris-monitor ]; then
|
||||
/usr/libexec/fenris/fenris-monitor disable --now 2>/dev/null || true
|
||||
# Only a real erase is a sanctioned disable. An upgrade must preserve
|
||||
# both monitoring intent and the active runit service.
|
||||
if [ "${UPDATE}" = "no" ]; then
|
||||
# Close the monitoring period while the store is still available.
|
||||
if [ -x /usr/libexec/fenris/fenris-monitor ]; then
|
||||
/usr/libexec/fenris/fenris-monitor disable --now 2>/dev/null || true
|
||||
fi
|
||||
# Configuration and the observation store are deliberately not
|
||||
# package-owned. Leave them in place: XBPS does not guarantee a
|
||||
# post-remove callback before its cleanup action.
|
||||
# runit: remove the service symlink and mark dormant
|
||||
rm -f /var/service/fenris-collect
|
||||
touch /etc/sv/fenris-collect/down 2>/dev/null || true
|
||||
fi
|
||||
# runit: remove the service symlink and mark dormant
|
||||
rm -f /var/service/fenris-collect
|
||||
touch /etc/sv/fenris-collect/down 2>/dev/null || true
|
||||
;;
|
||||
purge)
|
||||
# Full cleanup — remove config, store, and runit service directories
|
||||
rm -rf /etc/fenris
|
||||
rm -rf /var/lib/fenris
|
||||
if getent group fenris > /dev/null 2>&1; then
|
||||
groupdel fenris 2>/dev/null || true
|
||||
fi
|
||||
rm -rf /etc/sv/fenris-collect 2>/dev/null || true
|
||||
rm -rf /var/log/fenris-collect 2>/dev/null || true
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
Reference in New Issue
Block a user