Given podman is installed on a linux system and a systemd unit named baz.service:
# /etc/systemd/system/baz.service
[Service]
ExecStart=/usr/bin/podman run --rm --tty --name baz alpine sh -c 'while true; do date; sleep 1; done'
ExecStop=/usr/bin/podman stop baz
And the baz.service started:
# systemctl daemon-reload
# systemctl start baz.service
Then when I check the status of the unit I don't see the sh or sleep process in the /system.slice/baz.service cgroup
# systemctl status baz
● baz.service
Loaded: loaded (/etc/systemd/system/baz.service; static; vendor preset: enabl
Active: active (running) since Sat 2019-08-10 05:50:18 UTC; 14s ago
Main PID: 16910 (podman)
Tasks: 9
Memory: 7.3M
CPU: 68ms
CGroup: /system.slice/baz.service
└─16910 /usr/bin/podman run --rm --tty --name baz alpine sh -c while
# ...
I was expecting to see the sh and sleep children in my baz.service status because I've heard people from redhat say podman uses a traditional fork-exec model.
If podman did fork and exec, then wouldn't my sh and sleep process be children of podman and be in the same cgroup as the original podman process?
I was expecting to be able to use systemd and podman to be able to manage my containers without the children going off to a different parent and escape from my baz.service ssystemd unit.
Looking at the output of ps I can see that sh and sleep are actually children of a different process called conmon. I'm not sure where conmon came from, or how it was started but systemd didn't capture it.
# ps -Heo user,pid,ppid,comm
# ...
root 17254 1 podman
root 17331 1 conmon
root 17345 17331 sh
root 17380 17345 sleep
From the output it's clear that my baz.service unit is not managing the conmon -> sh -> sleep chain.
- How is podman different from the docker client server model?
- How is podman's conmon different from docker's containerd?
Maybe they are both container runtimes and the the dockerd daemon is what people people want to get rid of.
So maybe docker is like:
- dockerd daemon
- docker cli
- containerd container runtime
And podman is like:
- podman cli
- conmon container runtime
So maybe podman uses a traditional fork exec model but it's not the podman cli that's forking and exec, it's the conmon process.
I feel confused.