I’m having some trouble keeping my container open after seemingly random units of time.
On Arch Linux 7.0.12 using lxc 1:7.0.0-1, I’m trying to run a container to host a jellyfin server on my local network. The container starts up just fine, jellyfin runs and I’m able to use it normally. However, after the container has been running for anywhere from about 30 minutes to 9 hours, systemd decides to kill the container with a failure result of “timeout.“ If it matters, I’m running an unprivileged container as my local user (not root) started with the lxc-start jellyfin command and a systemd unit to delegate the cgroup.
I’ve tried creating a systemd.service to run lxc-start and to set the timeout to infinity, but this hasn’t worked because this doesn’t attach to the pid for the container, lxc-start just starts the container and exits. I cant seem to find any configuration options on lxc.container.conf that would allow me to influence the lxc-jellyfin-0.scope generated by lxc-start to disable timeout.
One could certainly write a monitor script to check if the container is running and then restart it, but this is a little too hacky and I’m hoping for a more elegant solution. I could also go the route of proxmox and docker, but I’m trying to specifically see if I can fix this without dealing with the headache of migrating and learning a new set of tools.
Is there a simple way to keep my containers open that I’m not thinking about? Please send help
Below is journalctl output from an example of when systemd has decided to shut my container down
Jun 21 00:08:28 baremetal systemd[7245]: lxc-jellyfin-0.scope: Stopping timed out. Killing.
Jun 21 00:08:28 baremetal systemd[7245]: lxc-jellyfin-0.scope: Killing process 8275 (lxc-start) with signal SIGKILL.
Jun 21 00:08:28 baremetal systemd[7245]: lxc-jellyfin-0.scope: Killing process 8278 (systemd) with signal SIGKILL.
Jun 21 00:08:28 baremetal kernel: br0: port 2(veth1000_rhR2) entered disabled state
Jun 21 00:08:28 baremetal kernel: veth1000_rhR2 (unregistering): left allmulticast mode
Jun 21 00:08:28 baremetal kernel: veth1000_rhR2 (unregistering): left promiscuous mode
Jun 21 00:08:28 baremetal kernel: br0: port 2(veth1000_rhR2) entered disabled state
Jun 21 00:08:28 baremetal systemd[7245]: lxc-jellyfin-0.scope: Failed with result ‘timeout’.
Jun 21 00:08:28 baremetal systemd[7245]: Stopped lxc-jellyfin-0.scope.
Jun 21 00:08:28 baremetal systemd[7245]: lxc-jellyfin-0.scope: Consumed 2min 7.305s CPU time over 1h 21min 18.601s wall clock time, 1.8G memory peak.
Jun 21 00:08:28 baremetal systemd[7245]: Removed slice User Application Slice.
Jun 21 00:08:28 baremetal systemd[7245]: app.slice: Consumed 2min 7.312s CPU time over 2h 16min 41.067s wall clock time, 1.8G memory peak.
Jun 21 00:08:28 baremetal systemd[7245]: Reached target Shutdown.
Jun 21 00:08:28 baremetal systemd[7245]: Finished Exit the Session.
Jun 21 00:08:28 baremetal systemd[7245]: Reached target Exit the Session.
Jun 21 00:08:28 baremetal systemd-logind[374]: Removed session 6.
Jun 21 00:08:28 baremetal (sd-pam)[7247]: pam_unix(systemd-user:session): session closed for user tsero
Jun 21 00:08:28 baremetal systemd[1]: user@1000.service: Deactivated successfully.
Jun 21 00:08:28 baremetal systemd[1]: Stopped User Manager for UID 1000.
Jun 21 00:08:28 baremetal systemd[1]: user@1000.service: Consumed 2min 7.526s CPU time over 2h 16min 41.204s wall clock time, 1.8G memory peak.
Jun 21 00:08:28 baremetal systemd[1]: Stopping User Runtime Directory /run/user/1000…
Jun 21 00:08:28 baremetal systemd[1]: run-user-1000.mount: Deactivated successfully.
Jun 21 00:08:28 baremetal systemd[1]: user-runtime-dir@1000.service: Deactivated successfully.
Jun 21 00:08:28 baremetal systemd[1]: Stopped User Runtime Directory /run/user/1000.
Jun 21 00:08:28 baremetal systemd[1]: Removed slice User Slice of UID 1000.
Jun 21 00:08:28 baremetal systemd[1]: user-1000.slice: Consumed 3min 49.077s CPU time over 2h 16min 41.353s wall clock time, 14.7G memory peak.
Here’s the journalctl from inside the container
Jun 21 07:06:58 jellyfin systemd[1]: Received SIGTERM.
Jun 21 07:06:58 jellyfin systemd-networkd[147]: eth0: DHCP lease lost
Jun 21 07:06:58 jellyfin systemd-networkd[147]: eth0: DHCPv6 lease lost
Jun 21 07:06:58 jellyfin dbus-broker[160]: Dispatched 302 messages @ 3(±5)μs / message.
Jun 21 07:06:58 jellyfin systemd[1]: Reexecuting.
Jun 21 07:06:58 jellyfin jellyfin[161]: [07:06:58] [INF] Sending shutdown notifications
Jun 21 07:06:58 jellyfin systemd-journald[97]: Journal stopped