]> git.sesse.net Git - bcachefs-tools-debian/blob - fsck/bcachefsck_fail@.service.in
Makefile, fsck: Use libexec instead of lib
[bcachefs-tools-debian] / fsck / bcachefsck_fail@.service.in
1 # SPDX-License-Identifier: GPL-2.0
2 #
3 # Copyright (C) 2023-2024 Oracle.  All Rights Reserved.
4 # Author: Darrick J. Wong <djwong@kernel.org>
5
6 [Unit]
7 Description=Online bcachefsck Failure Reporting for %f
8 Documentation=man:bcachefs(8)
9
10 [Service]
11 Type=oneshot
12 Environment=EMAIL_ADDR=root
13 ExecStart=@libexecdir@/bcachefsck_fail "${EMAIL_ADDR}" bcachefs %f
14 User=mail
15 Group=mail
16 SupplementaryGroups=systemd-journal
17
18 # Create the service underneath the background service slice so that we can
19 # control resource usage.
20 Slice=system-bcachefsck.slice
21
22 # No realtime scheduling
23 RestrictRealtime=true
24
25 # Make the entire filesystem readonly and /home inaccessible.
26 ProtectSystem=full
27 ProtectHome=yes
28 PrivateTmp=true
29 RestrictSUIDSGID=true
30
31 # Emailing reports requires network access, but not the ability to change the
32 # hostname.
33 ProtectHostname=true
34
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
40 ProtectProc=invisible
41 RestrictNamespaces=true
42
43 # Can't hide /proc because journalctl needs it to find various pieces of log
44 # information
45 #ProcSubset=pid
46
47 # Only allow the default personality Linux
48 LockPersonality=true
49
50 # No writable memory pages
51 MemoryDenyWriteExecute=true
52
53 # Don't let our mounts leak out to the host
54 PrivateMounts=true
55
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
62
63 # xfs_scrub needs these privileges to run, and no others
64 CapabilityBoundingSet=
65 NoNewPrivileges=true
66
67 # Failure reporting shouldn't create world-readable files
68 UMask=0077
69
70 # Clean up any IPC objects when this unit stops
71 RemoveIPC=true
72
73 # No access to hardware device files
74 PrivateDevices=true
75 ProtectClock=true