Pigmoral Tech

Podman exits when SSH session ends

I found that when I exit from a SSH session on my server, the server running in Podman becomes invalid.

After searching, I found that this is because the Podman containers are started by normal users, and systemd loginctl will kill user processes when the users logout.

To check, run:

$ loginctl list-users

and I got this:

 UID USER     LINGER
1000 pigmoral no

1 users listed.

To fix this, we can enable the linger for the user, which will take care of the user processes when the user logs out:

$ loginctl enable-linger [USER...]

Run loginctl list-users again:

 UID USER     LINGER
1000 pigmoral yes

1 users listed.

You can now quit without worrying about your containers.

References:

Running Anlogic TD on Apple Silicon through UTM
Use pbcopy in SSH sessions