Use systemd to start podman containers.
Container information:
Double check the name of the container using the podman ps command. Use the container name as the unit filename and as the commands for ExecStart & ExecStop in the unit file.
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
411a6c6be7d8 docker.io/library/test-server:latest docker-entrypoint.s... 40 minutes ago Up 30 minutes ago 0.0.0.0:6379->6379/tcp <name>Make systemd unit file:
/etc/systemd/system/<name>.service[Unit]
Description=Podman container description here
Wants=syslog.service
[Service]
Restart=always
ExecStart=/usr/bin/podman start -a <name>
ExecStop=/usr/bin/podman stop -t 10 <name>
[Install]
WantedBy=multi-user.targetEnable service:
sudo systemctl enable <name>.service
sudo systemctl start <name>.service