Problems rebooting container

chudak

Well-Known Member
May 11, 2019
327
17
58
I run emby in a container and notice an odd behavior.
To reproduce use these steps:

start emby streaming on a laptop
try rebooting emby container >>> I see that reboot gets stuck for a long time (maybe a couple of minutes) and i shaving troubles to reboot.

My take is that proxmox is dealing with a running process and timing out.
Wonder if other people have seen this and if there is a way to handle this more gratefully.

Thx
 
PVE's way of rebooting involves the init daemon (usually systemd) inside the container that it should shut down - if a process within the container is blocking the shutdown, e.g. some daemon that doesn't listen to such events, then the shutdown (and subsequent reboot) doesn't happen.

Try opening a shell with 'pct enter' or via SSH and checking the journal or 'systemctl' during a stuck shutdown operation.
 
PVE's way of rebooting involves the init daemon (usually systemd) inside the container that it should shut down - if a process within the container is blocking the shutdown, e.g. some daemon that doesn't listen to such events, then the shutdown (and subsequent reboot) doesn't happen.

Try opening a shell with 'pct enter' or via SSH and checking the journal or 'systemctl' during a stuck shutdown operation.

You meant 'pct enter xxx' in PVE shell?

It logs me in that container under normal operations
 
Yes, and then use 'journalctl -e' or 'journalctl -f' (latter behaves like 'tail -f' and follows the log) before (or after) issuing the shutdown command. It might log you out when you do the shutdown, but you should be able to get back in (usually via SSH at least). If not, do a full 'stop' from the GUI, restart the container, and then check the logs from the shutdown.

Also check your 'emby' service, and make sure it reacts to SIGTERM and is configured correctly in systemd, if it uses that.
 
Yes, and then use 'journalctl -e' or 'journalctl -f' (latter behaves like 'tail -f' and follows the log) before (or after) issuing the shutdown command. It might log you out when you do the shutdown, but you should be able to get back in (usually via SSH at least). If not, do a full 'stop' from the GUI, restart the container, and then check the logs from the shutdown.

Also check your 'emby' service, and make sure it reacts to SIGTERM and is configured correctly in systemd, if it uses that.

emby service:

Code:
cat /usr/lib/systemd/system/emby-server.service
[Unit]
Description=Emby Server is a personal media server with apps on just about every device.
After=network.target


[Service]
EnvironmentFile=/etc/emby-server.conf
WorkingDirectory=/opt/emby-server
ExecStart=/opt/emby-server/bin/emby-server
RestartForceExitStatus=3
User=emby


[Install]
WantedBy=multi-user.target

During long reboot I saw in the task dialog "lxc-stop: 1000: commands_utils.c: lxc_cmd_sock_rcv_state: 50 Resource temporarily unavailable - Failed to receive message"

Looked in `/var/log/kern.log` but nothing I could see

Any suggestions ?
 
Last edited: