I am using Fedora IoT on a raspberry pi 4B.
I am using linuxserver.io containers in podman. I have actually created services that create the containers so they update automaticall and all. Here’s an example of the transmission container file:
$ cat container-transmission.service
# container-transmission.service
# autogenerated by Podman 3.3.1
# Mon Sep 13 23:10:20 EEST 2021
[Unit]
Description=Podman container-transmission.service
Documentation=man:podman-generate-systemd(1)
Wants=network-online.target
After=network-online.target
RequiresMountsFor=%t/containers
[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure
TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/%n.ctr-id
ExecStart=/usr/bin/podman run \
--cidfile=%t/%n.ctr-id \
--sdnotify=conmon \
--cgroups=no-conmon \
--rm \
--replace -d \
--name=transmission \
-e PUID=1000 \
-e PGID=1000 \
-e TZ=Europe/Athens \
-e TRANSMISSION_WEB_HOME=/kettu/ \
-e USER=USERNAME_REDACTED \
-e PASS=PASSWORD_REDACTED \
-p 9091:9091 \
-p 51413:51413 \
-p 51413:51413/udp \
-v /var/home/$USER/transmission/config:/config:z \
-v /var/home/$USER/transmission/downloads:/downloads:z \
-v /var/home/$USER/transmission/watch:/watch:z \
--network=net1 \
--label "io.containers.autoupdate=registry" \
lscr.io/linuxserver/transmission
ExecStop=/usr/bin/podman stop --ignore --cidfile=%t/%n.ctr-id
ExecStopPost=/usr/bin/podman rm -f --ignore --cidfile=%t/%n.ctr-id
Type=notify
NotifyAccess=all
[Install]
WantedBy=multi-user.target default.target
The problem is that containers loose internet access or proper DNS over time for some unknown reason.
From within the transmission container:
root@47077c6149e5:/# ping -c 4 www.google.com
ping: bad address 'www.google.com'
From the server’s terminal:
$ ping -c 4 www.google.com
PING www.google.com (142.250.185.68) 56(84) bytes of data.
64 bytes from fra16s48-in-f4.1e100.net (142.250.185.68): icmp_seq=1 ttl=115 time=45.1 ms
64 bytes from fra16s48-in-f4.1e100.net (142.250.185.68): icmp_seq=2 ttl=115 time=44.7 ms
64 bytes from fra16s48-in-f4.1e100.net (142.250.185.68): icmp_seq=3 ttl=115 time=44.9 ms
64 bytes from fra16s48-in-f4.1e100.net (142.250.185.68): icmp_seq=4 ttl=115 time=44.7 ms
--- www.google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
If I manually reboot then everything is working.
If I restart the service, which kills the container and starts a new one, the problem remains. Only a reboot fixes it which makes me suspect a problem in podman. Any ideas how to debug or fix this?
At the moment I m running 3 containers on the pi. SWAG, transmision and ddclient.
After rebooting, from within the transmission container:
root@278680d94006:/# ping -c 4 www.google.com
PING www.google.com (172.217.169.164): 56 data bytes
64 bytes from 172.217.169.164: seq=0 ttl=42 time=43.764 ms
64 bytes from 172.217.169.164: seq=1 ttl=42 time=42.895 ms
64 bytes from 172.217.169.164: seq=2 ttl=42 time=42.723 ms
64 bytes from 172.217.169.164: seq=3 ttl=42 time=42.738 ms
--- www.google.com ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 42.723/43.030/43.764 ms