You can control the state of the systemd system and service manager by using the systemctl command. You can enable, start, stop the service as a non-root user. To install the service as a root user, omit the --user option.
Before you begin
- The
container-tools meta-package is installed.
Procedure
-
Reload systemd manager configuration:
# systemctl --user daemon-reload
-
Enable the service
container.service and start it at boot time:
# systemctl --user enable container.service
-
Start the service immediately:
# systemctl --user start container.service
-
Check the status of the service:
$ systemctl --user status container.service
● container.service - Podman container.service
Loaded: loaded (/home/user/.config/systemd/user/container.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2020-09-16 11:56:57 CEST; 8s ago
Docs: man:podman-generate-systemd(1)
Process: 80602 ExecStart=/usr/bin/podman run --conmon-pidfile //run/user/1000/container.service-pid --cidfile //run/user/1000/container.service-cid -d ubi10-minimal:>
Process: 80601 ExecStartPre=/usr/bin/rm -f //run/user/1000/container.service-pid //run/user/1000/container.service-cid (code=exited, status=0/SUCCESS)
Main PID: 80617 (conmon)
CGroup: /user.slice/user-1000.slice/user@1000.service/container.service
├─ 2870 /usr/bin/podman
├─80612 /usr/bin/pasta --disable-host-loopback --mtu 65520 --enable-sandbox --enable-seccomp -c -e 3 -r 4 --netns-type=path /run/user/1000/netns/cni->
├─80614 /usr/bin/fuse-overlayfs -o lowerdir=/home/user/.local/share/containers/storage/overlay/l/YJSPGXM2OCDZPLMLXJOW3NRF6Q:/home/user/.local/share/contain>
├─80617 /usr/bin/conmon --api-version 1 -c cbc75d6031508dfd3d78a74a03e4ace1732b51223e72a2ce4aa3bfe10a78e4fa -u cbc75d6031508dfd3d78a74a03e4ace1732b51223e72>
└─cbc75d6031508dfd3d78a74a03e4ace1732b51223e72a2ce4aa3bfe10a78e4fa
└─80626 /usr/bin/coreutils --coreutils-prog-shebang=sleep /usr/bin/sleep 1d
You can check if the service is enabled by using the systemctl is-enabled container.service command.
-
Optional: To stop
container.service, enter:
# systemctl --user stop container.service
Results
- List containers that are running or have exited:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f20988d59920 registry.access.redhat.com/ubi10-minimal:latest top 12 seconds ago Up 11 seconds ago funny_zhukovsky