lxd cannot shutdown container
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
systemd (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
I found this issue when working with lxd and submitted a ticket there but the lxc people said it was related to systemd, not lxc.
The issue is: I have a container running under lxc/lxd. lxc stop of the container does not work whereas if I execute "shutdown now" inside the container it does stop as expected.
The associated lxd ticket is here:
https:/
The output of journalctl -a is at the end of this message
The syslog of that same run can be found here: http://
and this is the output of ps aux:
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.1 37808 4576 ? Ss 11:19 0:00 /sbin/init
root 48 0.0 0.0 35276 3004 ? Ss 11:19 0:00 /lib/systemd/
root 49 0.0 0.0 41724 1912 ? Ss 11:19 0:00 /lib/systemd/
message+ 514 0.0 0.0 42900 2460 ? Ss 11:19 0:00 /usr/bin/
root 704 0.0 0.0 18252 2508 ? Ss 11:55 0:00 bash
root 720 0.0 0.0 34556 1992 ? R+ 11:59 0:00 ps aux
Note that this may be timing related. If I stop the container immediately after starting things work. If I stop after a minute or so, the stop will not get through. (even not on a 2nd or 3rd attempt). However if I leave the container for a while then a new lxc stop will terminate the container. (this happened after an hour or so).
The issue is reproducible but seems to be dependend on what is running inside the container.
container runs ubuntu 16.04 on a 16.04 host.
systemd --version says:
systemd 229
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ -LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN
lxc sends SIGRTMIN+3 to systemd to stop. This was apparently discussed here: https:/
Let me know if more info is needed.
Frans
-- Logs begin at Sun 2017-02-26 11:19:12 UTC, end at Sun 2017-02-26 11:23:05 UTC. --
Feb 26 11:19:12 D-wan-61-1 systemd-
Feb 26 11:19:12 D-wan-61-1 systemd-
Feb 26 11:19:12 D-wan-61-1 systemd-sysctl[42]: Couldn't write '4 4 1 7' to 'kernel/printk', ignoring: Permission denied
Feb 26 11:19:12 D-wan-61-1 systemd-sysctl[42]: Couldn't write '176' to 'kernel/sysrq', ignoring: Permission denied
Feb 26 11:19:12 D-wan-61-1 systemd-sysctl[42]: Couldn't write '1' to 'fs/protected_
Feb 26 11:19:12 D-wan-61-1 systemd-sysctl[42]: Couldn't write '1' to 'net/ipv4/
Feb 26 11:19:12 D-wan-61-1 systemd-sysctl[42]: Couldn't write '1' to 'kernel/
Feb 26 11:19:12 D-wan-61-1 systemd-sysctl[42]: Couldn't write '1' to 'fs/protected_
Feb 26 11:19:12 D-wan-61-1 systemd-sysctl[42]: Couldn't write '1' to 'kernel/
Feb 26 11:19:12 D-wan-61-1 systemd-sysctl[42]: Couldn't write '65536' to 'vm/mmap_min_addr', ignoring: Permission denied
Feb 26 11:19:12 D-wan-61-1 systemd[1]: systemd-
Feb 26 11:19:12 D-wan-61-1 systemd[1]: Failed to start Apply Kernel Variables.
Feb 26 11:19:12 D-wan-61-1 systemd[1]: systemd-
Feb 26 11:19:12 D-wan-61-1 systemd[1]: systemd-
Feb 26 11:19:12 D-wan-61-1 systemd-
Feb 26 11:19:12 D-wan-61-1 systemd[1]: Started Uncomplicated firewall.
Feb 26 11:19:12 D-wan-61-1 systemd[1]: Failed to reset devices.list on /system.
Feb 26 11:19:12 D-wan-61-1 systemd[1]: Started udev Kernel Device Manager.
Feb 26 11:19:12 D-wan-61-1 mount[45]: mount: permission denied
Feb 26 11:19:12 D-wan-61-1 systemd[1]: Started Nameserver information manager.
Feb 26 11:19:12 D-wan-61-1 systemd[1]: dev-hugepages.
Feb 26 11:19:12 D-wan-61-1 systemd[1]: Failed to mount Huge Pages File System.
Feb 26 11:19:12 D-wan-61-1 systemd[1]: dev-hugepages.
Feb 26 11:19:12 D-wan-61-1 systemd-
Feb 26 11:19:12 D-wan-61-1 systemd-
Feb 26 11:19:12 D-wan-61-1 systemd[1]: systemd-
Feb 26 11:19:12 D-wan-61-1 systemd[1]: Failed to start Remount Root and Kernel File Systems.
Feb 26 11:19:12 D-wan-61-1 systemd[1]: systemd-
Feb 26 11:19:12 D-wan-61-1 systemd[1]: systemd-
Feb 26 11:19:12 D-wan-61-1 systemd[1]: Failed to reset devices.list on /system.
Feb 26 11:19:12 D-wan-61-1 systemd[1]: Starting Load/Save Random Seed...
Feb 26 11:19:12 D-wan-61-1 systemd[1]: Failed to reset devices.list on /system.
Feb 26 11:19:12 D-wan-61-1 systemd[1]: Starting udev Coldplug all Devices...
Feb 26 11:19:12 D-wan-61-1 systemd[1]: Failed to reset devices.list on /system.
Feb 26 11:19:12 D-wan-61-1 systemd[1]: Starting Flush Journal to Persistent Storage...
Feb 26 11:19:12 D-wan-61-1 systemd[1]: Failed to reset devices.list on /system.
Feb 26 11:19:12 D-wan-61-1 systemd[1]: Starting Initial cloud-init job (pre-networking)...
Feb 26 11:19:12 D-wan-61-1 systemd[1]: Failed to reset devices.list on /system.
Feb 26 11:19:12 D-wan-61-1 systemd[1]: Started Flush Journal to Persistent Storage.
Feb 26 11:19:12 D-wan-61-1 systemd[1]: Started Load/Save Random Seed.
Feb 26 11:19:12 D-wan-61-1 systemd[1]: lvm2-lvmetad.
Feb 26 11:19:12 D-wan-61-1 lvm[43]: Daemon lvmetad returned error 104
Feb 26 11:19:12 D-wan-61-1 lvm[43]: WARNING: Failed to connect to lvmetad. Falling back to internal scanning.
Feb 26 11:19:12 D-wan-61-1 systemd[1]: lvm2-lvmetad.
Feb 26 11:19:12 D-wan-61-1 systemd[1]: Started Monitoring of LVM2 mirrors, snapshots etc. using dmeventd or progress polling.
Feb 26 11:19:12 D-wan-61-1 systemd[1]: Reached target Local File Systems (Pre).
Feb 26 11:19:12 D-wan-61-1 systemd[1]: Reached target Local File Systems.
Feb 26 11:19:12 D-wan-61-1 systemd[1]: Failed to reset devices.list on /system.
Feb 26 11:19:12 D-wan-61-1 systemd[1]: Created slice system-getty.slice.
Feb 26 11:19:12 D-wan-61-1 systemd[1]: Failed to reset devices.list on /system.
Feb 26 11:19:12 D-wan-61-1 systemd[1]: Starting Create Volatile Files and Directories...
Feb 26 11:19:12 D-wan-61-1 systemd[1]: Failed to reset devices.list on /system.
Feb 26 11:19:12 D-wan-61-1 systemd[1]: Starting Tell Plymouth To Write Out Runtime Data...
Changed in systemd (Ubuntu): | |
status: | New → Fix Released |
Note, that since a while LXC is sending SIGRTMIN+3 to systemd. So unless systemd has changed it's shutdown/halt signal again LXC should send the right signal.