The tool "/usr/sbin/xfs_scrub_all" requires the Python module "dbus" from the package "dev-python/dbus-python" to work, but the package is not included in the dependencies of "sys-fs/xfsprogs". Reproducible: Always Steps to Reproduce: 1. Run the service unit "xfs_scrub_all.service" without "dev-python/dbus-python" installed. Actual Results: Apr 29 13:25:55 alpha01 systemd[1]: Starting Online XFS Metadata Check for All Filesystems... Apr 29 13:25:55 alpha01 xfs_scrub_all[1067714]: Traceback (most recent call last): Apr 29 13:25:55 alpha01 xfs_scrub_all[1067714]: File "/usr/sbin/xfs_scrub_all", line 18, in <module> Apr 29 13:25:55 alpha01 xfs_scrub_all[1067714]: import dbus Apr 29 13:25:55 alpha01 xfs_scrub_all[1067714]: ModuleNotFoundError: No module named 'dbus' Apr 29 13:25:55 alpha01 systemd[1]: xfs_scrub_all.service: Main process exited, code=exited, status=1/FAILURE Apr 29 13:25:55 alpha01 systemd[1]: xfs_scrub_all.service: Failed with result 'exit-code'. Apr 29 13:25:55 alpha01 systemd[1]: Failed to start Online XFS Metadata Check for All Filesystems. Apr 29 13:25:55 alpha01 systemd[1]: xfs_scrub_all.service: Triggering OnFailure= dependencies. Expected Results: Apr 29 13:30:19 alpha01 systemd[1]: Starting Online XFS Metadata Check for All Filesystems... Apr 29 13:30:19 alpha01 xfs_scrub_all[1074405]: Automatically enabling file data scrub. Apr 29 13:30:19 alpha01 xfs_scrub_all[1074405]: Scrubbing /... Apr 29 13:30:22 alpha01 xfs_scrub_all[1074405]: Scrubbing / done, (err=0) Apr 29 13:30:24 alpha01 systemd[1]: xfs_scrub_all.service: Deactivated successfully. Apr 29 13:30:24 alpha01 systemd[1]: Finished Online XFS Metadata Check for All Filesystems.
The Python script was added in v4.15.0. https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/commit/?id=f1dca11cad13086a30df05bed57b600abf06374d The python-dbus dependency was added in v6.10.0. https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/commit/?id=6d831e770359fffdfa53d1049776da81a1417a4a
Wonder how best to fix this. Feels unfortunate to introduce a dep on something quite fundamental when only the systemd unit needs it.
Yeah, I hesitate to depend on it unconditionally for something many people will never use. Maybe an optfeature message?
(In reply to Sam James from comment #2) > Wonder how best to fix this. Feels unfortunate to introduce a dep on > something quite fundamental when only the systemd unit needs it. Why should this be a systemd problem? Is the "/usr/sbin/xfs_scrub_all" tool only used in a systemd unit?
It's not systemd-only. However, I suspect few people actually run xfs_scrub_all.
Sorry, I thought that script was only used by the service. I thought also that the script was systemd-only, but it isn't: # Run per-mount systemd xfs_scrub service only if we ourselves # are running as a systemd service. if 'SERVICE_MODE' in os.environ: ret = run_service(mnt, scrub_media, killfuncs) if ret == 0 or ret == 1: print("Scrubbing %s done, (err=%d)" % (mnt, ret)) sys.stdout.flush() retcode |= ret return if terminate: return # Invoke xfs_scrub manually if we're running in the foreground. # We also permit this if we're running as a cronjob where # systemd services are unavailable. ret = run_subprocess(mnt, scrub_media, killfuncs) if ret >= 0: Just the dbus functionality (and service functionality) is. Nonetheless, it's niche.
For non-systemd systems, there is a cron file: /usr/share/xfsprogs/xfs_scrub_all.cron And just like the timer unit, this isn't enabled by default, so few users use it.