]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfsprogs-dev.git/commitdiff
debian: enable xfs_healer on the root filesystem by default
authorDarrick J. Wong <djwong@kernel.org>
Sun, 22 Feb 2026 22:41:18 +0000 (14:41 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 9 Apr 2026 22:30:18 +0000 (15:30 -0700)
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" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
debian/postinst
debian/prerm [new file with mode: 0644]
debian/rules

index d11c8d94a3cbe451a0c2978f6e51188a31baaded..966dbb7626cab344877e1b41831d32eb10fd1e68 100644 (file)
@@ -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 (file)
index 0000000..c526dcd
--- /dev/null
@@ -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
index 7c9f90e6c483ffb20c915aaffe718673c6219a5c..aaf99a95ce3df5f4a85a4ad4274ce9a1d62a908a 100755 (executable)
@@ -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