systemd(user): add podman unit, slice files

* podman user service (rootless) is autostarted (enabled)
This commit is contained in:
surtur 2021-11-10 02:36:20 +01:00
parent d03d466672
commit 930e692a47
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D
3 changed files with 38 additions and 0 deletions

@ -0,0 +1,19 @@
[Unit]
Description=Podman API Service
Requires=podman.socket
After=podman.socket
Documentation=man:podman-system-service(1)
StartLimitIntervalSec=0
[Service]
Slice=podman.slice
; Delegate=yes
Delegate=cpu cpuset memory pids io
Type=exec
KillMode=process
Environment=LOGGING="--log-level=info"
ExecStart=/usr/bin/podman --cgroup-manager=systemd $LOGGING system service
[Install]
; WantedBy=multi-user.target
WantedBy=sway-session.target

@ -0,0 +1,18 @@
[Unit]
Description=Slice that limits podman resources
Before=slices.target
# refs:
# https://baykara.medium.com/docker-resource-management-via-cgroups-and-systemd-633b093a835c
# https://docs.docker.com/engine/reference/commandline/dockerd/#docker-runtime-execution-op>
[Slice]
CPUAccounting=yes
# 100% is an equivalent of full utilization on a single core
# we allow for 85% here - applies to all docker.service-spawn
# processes cumulatively
# CPUQuota=85%
CPUQuota=50%
MemoryAccounting=yes
MemoryHigh=10G
MemoryMax=12G
MemorySwapMax=1G

@ -0,0 +1 @@
../podman.service