1 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (C) 2023-2024 Oracle. All Rights Reserved.
4 # Author: Darrick J. Wong <djwong@kernel.org>
7 Description=Online bcachefsck Failure Reporting for %f
8 Documentation=man:bcachefs(8)
12 Environment=EMAIL_ADDR=root
13 ExecStart=@libexecdir@/bcachefsck_fail "${EMAIL_ADDR}" bcachefs %f
16 SupplementaryGroups=systemd-journal
18 # Create the service underneath the background service slice so that we can
19 # control resource usage.
20 Slice=system-bcachefsck.slice
22 # No realtime scheduling
25 # Make the entire filesystem readonly and /home inaccessible.
31 # Emailing reports requires network access, but not the ability to change the
35 # Don't let the program mess with the kernel configuration at all
36 ProtectKernelLogs=true
37 ProtectKernelModules=true
38 ProtectKernelTunables=true
39 ProtectControlGroups=true
41 RestrictNamespaces=true
43 # Can't hide /proc because journalctl needs it to find various pieces of log
47 # Only allow the default personality Linux
50 # No writable memory pages
51 MemoryDenyWriteExecute=true
53 # Don't let our mounts leak out to the host
56 # Restrict system calls to the native arch and only enough to get things going
57 SystemCallArchitectures=native
58 SystemCallFilter=@system-service
59 SystemCallFilter=~@privileged
60 SystemCallFilter=~@resources
61 SystemCallFilter=~@mount
63 # xfs_scrub needs these privileges to run, and no others
64 CapabilityBoundingSet=
67 # Failure reporting shouldn't create world-readable files
70 # Clean up any IPC objects when this unit stops
73 # No access to hardware device files