mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-01-22 00:04:31 +03:00
fbfdd05ac5
Add some systemd service files so that bcachefs can automatically fsck mounted filesystems in the background. Hopefully with minimal disruption to frontend operations. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
31 lines
1.2 KiB
SYSTEMD
31 lines
1.2 KiB
SYSTEMD
# SPDX-License-Identifier: GPL-2.0
|
|
#
|
|
# Copyright (C) 2023-2024 Oracle. All Rights Reserved.
|
|
# Author: Darrick J. Wong <djwong@kernel.org>
|
|
|
|
[Unit]
|
|
Description=bcachefsck background service slice
|
|
Before=slices.target
|
|
|
|
[Slice]
|
|
|
|
# If the CPU usage cgroup controller is available, don't use more than 60% of a
|
|
# single core for all background processes.
|
|
CPUQuota=60%
|
|
CPUAccounting=true
|
|
|
|
[Install]
|
|
# As of systemd 249, the systemd cgroupv2 configuration code will drop resource
|
|
# controllers from the root and system.slice cgroups at startup if it doesn't
|
|
# find any direct dependencies that require a given controller. Newly
|
|
# activated units with resource control directives are created under the system
|
|
# slice but do not cause a reconfiguration of the slice's resource controllers.
|
|
# Hence we cannot put CPUQuota= into the bcachefsck service units directly.
|
|
#
|
|
# For the CPUQuota directive to have any effect, we must therefore create an
|
|
# explicit definition file for the slice that systemd creates to contain the
|
|
# bcachefsck instance units (e.g. bcachefsck@.service) and we must configure this
|
|
# slice as a dependency of the system slice to establish the direct dependency
|
|
# relation.
|
|
WantedBy=system.slice
|