[systemd-devel] Error handling problems with systemd-machined

Daniel P. Berrange berrange at redhat.com
Wed Jul 24 09:14:36 PDT 2013


On Wed, Jul 24, 2013 at 05:10:59PM +0100, Daniel P. Berrange wrote:
> On Wed, Jul 24, 2013 at 05:59:48PM +0200, Lennart Poettering wrote:
> > > Once I fixed the unit name to removing the leading '/', I hit a second
> > > error
> > > 
> > > recvmsg(5, {msg_name(0)=NULL, msg_iov(1)=[{"l\3\1\0014\0\0\0\301\1\0\0]\0\0\0\6\1s\0\6\0\0\0:1.126\0\0\4\1s\0#\0\0\0org.freedesktop.systemd1.UnitExists\0\0\0\0\0\5\1u\0\f\0\0\0\10\1g\0\1s\0\0\7\1s\0\4\0\0\0:1.1\0\0\0\0/\0\0\0Unit machine-lxc\\x2dbusy2.scope already exists.\0", 2048}], msg_controllen=0, msg_flags=MSG_CMSG_CLOEXEC}, MSG_CMSG_CLOEXEC) = 164
> > > 
> > >   "Unit machine-lxc\\x2dbusy2.scope already exists"
> > > 
> > > But neither "machinectl list" or "systemctl --full" show any such machine
> > > or unit existing. It seems like when it reported the bogus slice name,
> > > it did not fully clean up the transient scope unit it created. This is
> > > then blocking further attempts to create the same transient scope.
> > 
> > Hmm, that's interesting. What does "systemctl status" say for the unit
> > in question when this happens? Could you paste?
> 
> # systemctl status 'machine-lxc\x2dbusy4.scope'
> machine-lxc\x2dbusy4.scope
>    Loaded: stub (/run/systemd/system/machine-lxc\x2dbusy4.scope; static)
>    Active: inactive (dead)
> 
> > Kay had some issues where the kernel's release_agent wouldn't be called
> > on recent kernels, but I never had issues with that...
> 
> If systemd is complaining about the bogus slice name "/machine.slice"
> is it possible that it has returned this error, before it ever placed
> the "init" PID into the cgroup? The kernel release_agent would never
> trigger if there was no process any cgroup to exit, and thus the
> slice may not get cleaned up.

FYI, I can reproduce this with systemd-nspawn too


# systemd-nspawn --slice /machine.slice -D /mnt/demo/ -M foo  /bin/sh
Spawning namespace container on /mnt/demo (console is /dev/pts/5).
Init process in the container running as PID 32057.
Failed to register machine: Input/output error
Container failed with error code 251.

Run that multiple times and you'll see the 2nd time machined gets the
error about pre-existing unit.


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|


More information about the systemd-devel mailing list