[systemd-devel] systemd --test still tries to execute quite some actions and fails

Andrey Borzenkov arvidjaar at gmail.com
Fri Feb 18 03:38:13 PST 2011


On Fri, Feb 18, 2011 at 2:29 PM, Lennart Poettering
<lennart at poettering.net> wrote:
> On Fri, 18.02.11 13:42, Andrey Borzenkov (arvidjaar at gmail.com) wrote:
>
>> Example as non-root
>>
>> [bor at n2 ~]$ systemd  --system --unit=graphical.target --test > /tmp/foo
>> systemd 17 running in system mode. (+PAM +LIBWRAP +AUDIT -SELINUX
>> +SYSVINIT -LIBCRYPTSETUP; fedora)
>> FATAL: Could not load /lib/modules/2.6.33.7-server-2mnb/modules.dep:
>> No such file or directory
>> /sbin/modprobe failed with error code 1.
>> Failed to set hostname to <n2.mandriva.com>: Operation not permitted
>> Netlink failure for request 1: Operation not permitted
>> Failed to configure loopback device: Operation not permitted
>> /etc/mtab is not a symlink or not pointing to /proc/self/mounts. This
>> is not supported anymore. Please make sure to replace this file by a
>> symlink to avoid incorrect or misleading mount(8) output.
>> Failed to enable ctrl-alt-del handling: Operation not permitted
>> Failed to open /dev/tty0: Permission denied
>> Failed to allocate manager object: No such file or directory
>
> The only real problem here is the last line, the rest is ignored.

No. The real problem is that it tries to do all of this. Fortunately
it is not permitted if running as non-root.

> Could
> you run this with --log-level=debug? This should give us an indication
> why the last line failed. (And also give us an indication which log
> message we should bump from "debug" to "info", so that the next one
> running into this problem will see what's going on)
>

[bor at n2 ~]$ systemd  --system --unit=graphical.target --test --log-level=debug
systemd 17 running in system mode. (+PAM +LIBWRAP +AUDIT -SELINUX
+SYSVINIT -LIBCRYPTSETUP; fedora)
Your kernel apparently lacks built-in autofs4 support. Might be a good
idea to compile it in. We'll now try to work around this by calling
'/sbin/modprobe autofs4'...
Your kernel apparently lacks built-in ipv6 support. Might be a good
idea to compile it in. We'll now try to work around this by calling
'/sbin/modprobe ipv6'...
About to execute: /sbin/modprobe -qab -- autofs4 ipv6
Forked /sbin/modprobe as 4605
FATAL: Could not load /lib/modules/2.6.33.7-server-2mnb/modules.dep:
No such file or directory
/sbin/modprobe failed with error code 1.
Failed to set hostname to <n2.mandriva.com>: Operation not permitted
Netlink failure for request 1: Operation not permitted
Failed to configure loopback device: Operation not permitted
/etc/mtab is not a symlink or not pointing to /proc/self/mounts. This
is not supported anymore. Please make sure to replace this file by a
symlink to avoid incorrect or misleading mount(8) output.
Looking for unit files in:
        /etc/systemd/system
        /lib/systemd/system
Looking for SysV init scripts in:
        /etc/rc.d/init.d
Looking for SysV rcN.d links in:
        /etc/rc.d
Failed to enable ctrl-alt-del handling: Operation not permitted
Failed to open /dev/tty0: Permission denied
Failed to allocate manager object: No such file or directory
[bor at n2 ~]$


>> example as root in chroot
>>
>> [iurt cooker] rootn2/home/bor$ systemd --system
>> --unit=graphical.target --test > /tmp/foo
>> Failed to mount /sys/fs/cgroup: No such file or directory
>>
>> well ... this makes --test rather useless. I definitely do not want it
>> to mess with anything on live system. All it is expected to do is
>> "Determine startup sequence, dump it and exit.", *not* trying to
>> mount, modprobe, etc etc
>
> Well, I didn't want to clutter the sources with too many "if
> (!in_test_mode)  { ... }", so I simply rely on the kernel refusing these
> operations.

Well ... I naively thought that "computing dependency" is pretty much
self consistent operation that can be executed right away as soon as
we see --test option ...

> And that does work properly, as you can see by the EPERMs
> shown. The big issue you running into is in the last line where the
> error isnt EPERM but ENOENT...
>
> Lennart
>
> --
> Lennart Poettering - Red Hat, Inc.
>


More information about the systemd-devel mailing list