From: Darrick J. Wong Date: Sun, 22 Feb 2026 22:41:18 +0000 (-0800) Subject: debian: enable xfs_healer on the root filesystem by default X-Git-Tag: v7.0.0~31 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bd61d2b9c8527f1f7bf86df45280ab46592bea7d;p=xfsprogs-dev.git debian: enable xfs_healer on the root filesystem by default Now that we're finished building autonomous repair, enable the healer service on the root filesystem by default. The root filesystem is mounted by the initrd prior to starting systemd, which is why the xfs_healer_start service cannot autostart the service for the root filesystem. dh_installsystemd won't activate a template service (aka one with an at-sign in the name) even if it provides a DefaultInstance directive to make that possible. Hence we enable this explicitly via the postinst script. Note that Debian enables services by default upon package installation, so this is consistent with their policies. Their kernel doesn't enable online fsck, so healer won't do much more than monitor for corruptions and log them. Signed-off-by: "Darrick J. Wong" Reviewed-by: Christoph Hellwig --- diff --git a/debian/postinst b/debian/postinst index d11c8d94..966dbb76 100644 --- a/debian/postinst +++ b/debian/postinst @@ -21,5 +21,13 @@ case "${1}" in esac #DEBHELPER# +# +# dh_installsystemd doesn't handle template services even if we supply a +# default instance, so we'll install it here. +if [ -z "${DPKG_ROOT:-}" ] && [ -d /run/systemd/system ] ; then + if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then + /bin/systemctl enable xfs_healer@.service || true + fi +fi exit 0 diff --git a/debian/prerm b/debian/prerm new file mode 100644 index 00000000..c526dcdd --- /dev/null +++ b/debian/prerm @@ -0,0 +1,13 @@ +#!/bin/sh + +set -e + +# dh_installsystemd doesn't handle template services even if we supply a +# default instance, so we'll install it here. +if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = remove ] && [ -d /run/systemd/system ] ; then + /bin/systemctl disable xfs_healer@.service || true +fi + +#DEBHELPER# + +exit 0 diff --git a/debian/rules b/debian/rules index 7c9f90e6..aaf99a95 100755 --- a/debian/rules +++ b/debian/rules @@ -97,4 +97,5 @@ override_dh_installdocs: dh_installdocs -XCHANGES override_dh_installsystemd: - dh_installsystemd -p xfsprogs --no-restart-after-upgrade --no-stop-on-upgrade system-xfs_scrub.slice xfs_scrub_all.timer + dh_installsystemd -p xfsprogs --no-restart-after-upgrade --no-stop-on-upgrade system-xfs_scrub.slice xfs_scrub_all.timer system-xfs_healer.slice + dh_installsystemd -p xfsprogs --restart-after-upgrade xfs_healer_start.service