# SPDX-License-Identifier: GPL-2.0-or-later
#
# Copyright (C) 2018-2024 Oracle.  All Rights Reserved.
# Author: Darrick J. Wong <djwong@kernel.org>

[Unit]
Description=Online XFS Metadata Check Failure Reporting for %f
Documentation=man:xfs_scrub(8)

[Service]
Type=oneshot
Environment=EMAIL_ADDR=root
ExecStart=/usr/libexec/xfsprogs/xfs_scrub_fail "${EMAIL_ADDR}" xfs_scrub %f
User=mail
Group=mail
SupplementaryGroups=systemd-journal

# Create the service underneath the scrub background service slice so that we
# can control resource usage.
Slice=system-xfs_scrub.slice

# No further restrictions because some installations may have MTAs such as
# postfix, which require the ability to run setgid programs and other
# foolishness.
