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

Lennart Poettering lennart at poettering.net
Fri Feb 18 03:29:34 PST 2011


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. 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)

> 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. 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