From a20e3585feaf72f0be0ca0177e3bbb523f372ff2 Mon Sep 17 00:00:00 2001 From: Dean Chen <862469039@qq.com> Date: Fri, 14 Aug 2026 08:37:27 +0500 Subject: [PATCH] docs: make rootless cgroup delegate.conf copy-pasteable Signed-off-by: Dean Chen <862469039@qq.com> --- .../manuals/engine/security/rootless/tips.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/content/manuals/engine/security/rootless/tips.md b/content/manuals/engine/security/rootless/tips.md index d0f810e9d932..82eef156c4aa 100644 --- a/content/manuals/engine/security/rootless/tips.md +++ b/content/manuals/engine/security/rootless/tips.md @@ -152,15 +152,23 @@ $ cat /sys/fs/cgroup/user.slice/user-$(id -u).slice/user@$(id -u).service/cgroup memory pids ``` -To allow delegation of all controllers, you need to change the systemd configuration as follows: +To allow delegation of all controllers, change the systemd configuration: ```console -# mkdir -p /etc/systemd/system/user@.service.d -# cat > /etc/systemd/system/user@.service.d/delegate.conf << EOF +$ sudo mkdir -p /etc/systemd/system/user@.service.d +``` + +Create `/etc/systemd/system/user@.service.d/delegate.conf`: + +```ini [Service] Delegate=cpu cpuset io memory pids -EOF -# systemctl daemon-reload +``` + +Then reload systemd: + +```console +$ sudo systemctl daemon-reload ``` > [!NOTE]