systemd(user): add podman unit, slice files
* podman user service (rootless) is autostarted (enabled)
This commit is contained in:
parent
d03d466672
commit
930e692a47
19
.config/systemd/user/podman.service
Normal file
19
.config/systemd/user/podman.service
Normal file
@ -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
|
18
.config/systemd/user/podman.slice
Normal file
18
.config/systemd/user/podman.slice
Normal file
@ -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
|
1
.config/systemd/user/sway-session.target.wants/podman.service
Symbolic link
1
.config/systemd/user/sway-session.target.wants/podman.service
Symbolic link
@ -0,0 +1 @@
|
||||
../podman.service
|
Loading…
Reference in New Issue
Block a user