Hi everyone.
I try to start a container at boot time using systemd. It follows this guide
I have a container named “unifi”.
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
0b3b250e03c4 localhost/unifi:6.0.41 /opt/unifi/unifi 12 days ago Up 1 second ago 0.0.0.0:3478->3478/udp, 0.0.0.0:5514->5514/udp, 0.0.0.0:8080->8080/tcp, 0.0.0.0:8443->8443/tcp, 0.0.0.0:8843->8843/tcp, 0.0.0.0:10001->10001/udp unifi
I did create a service file.
# /etc/systemd/system/unifi-container.service
[Unit]
Description=Unifi container
[Service]
Restart=always
ExecStart=/usr/bin/podman start -a unifi
ExecStop=/usr/bin/podman stop -t 2 unifi
[Install]
WantedBy=local.target
When I start the container manually with command systemctl start unfi-container it is working fine.
I enabled the service,
$ systemctl status unifi-container
● unifi-container.service - Unifi container
Loaded: loaded (/etc/systemd/system/unifi-container.service; enabled; vendor preset: disabled)
but after a reboot the container is not started. There’s no error message in the logs and no sign systemd even tries to start the container.