[systemd-devel] [PATCH] unit: When stopping due to BindsTo=, log which unit caused it

Alban Crequy alban at endocode.com
Fri Apr 24 08:10:13 PDT 2015


On Fri, Apr 24, 2015 at 12:45 PM, Lennart Poettering
<lennart at poettering.net> wrote:
> On Wed, 22.04.15 16:55, Alban Crequy (alban at endocode.com) wrote:
>
>> Thanks for the commits. They don't seem related to containers.
>>
>> I can reproduce my issue on git-master:
>>
>> sudo ~/git/systemd/systemd-nspawn --register=false --bind
>> $HOME/tmp/vol -D debian-tree -b
>>
>> Then, in the container, make sure /bin/umount does NOT exist.
>> Then halt the container with kill -37 1 (SIGRTMIN+3)
>
> We require /bin/mount and /bin/umount to exist. We do not support
> systems where you remove those. We also don't support systems without
> glibc either, ... ;-)

Fair enough about the dependency on umount/mount :)

I added /bin/mount and /bin/umount in the container for my test and
now systemd in the container says:

Unit opt-stage2-sha512(...)-rootfs-dir1.mount is bound to inactive
unit dev-disk-by\x2duuid-25ea81c8\x2d20d8\x2d4ab1\x2d862c\x2d882a04478837.device.
Stopping, too.

The directory /opt/stage2/sha512xxx/rootfs/dir1 is the bind mount
specified on the "systemd-nspawn --bind" command line. How can I tell
systemd in the nspawn container *not* to umount the volumes prepared
by nspawn?

Note that systemd is also trying to umount other bind-mounted
directories but it fails because the processes in the container are
using it:
umount: /opt/stage2/sha512-ba93cedc478ed21c03d690b5f026205f/rootfs:
target is busy

And systemd keeps trying to umount them in a busy loop.

How does systemd detect that dev-disk-by...device is "inactive"?

Cheers,
Alban


More information about the systemd-devel mailing list