[systemd-devel] stopping a systemd-nspwan container

Lennart Poettering lennart at poettering.net
Sun Mar 23 18:20:24 PDT 2014


On Sat, 22.03.14 16:35, Kevin Wilson (wkevils at gmail.com) wrote:

> Hello,
> 
> I had created a container according to systemd-nspwan man page and
> ran it by:
> systemd-nspawn -D/srv/mycontainer
> 
> I killed it by  pkill systemd-nspaw (and not by poweroff from within the
> container).
> 
> Now, running "machinectl" shows that the container still runs:
> machinectl
> MACHINE                          CONTAINER SERVICE
> mycontainer                      container nspawn
> 
> 1 machines listed.
> 
> but the following is strange:
> 
> Running:
> systemd-nspawn -D/srv/mycontainer
> gives:
> Spawning namespace container on /srv/mycontainer (console is /dev/pts/2).
> Init process in the container running as PID 2305.
> Failed to register machine: File exists
> Container failed with error code 239.
> 
> (and running it again gives the same result but with a different pid
> number).
> 
> Is there a way to shut down the container which is running in such a
> scenario ?

 systemctl stop machine-xyz.scope
 systemctl reset-failed

THis may happen sometimes since cgroup empty notifications is racy when
we have subcgroups. This will soonishly get fixed with the kernel cgroup
rework.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list