Bug#864341: systemd-sysctl: failed to apply sysctl config at bootup

Arturo Borrero Gonzalez arturo at debian.org
Thu Jul 13 12:32:46 BST 2017


On 13 July 2017 at 13:19, Michael Biebl <biebl at debian.org> wrote:
>
> systemd-modules-load uses libkmod/kmod_module_probe_insert_module() to
> load the modules:
> https://github.com/systemd/systemd/blob/master/src/modules-load/modules-load.c
>
>
> I.e. it's not doing something fancy here and uses the same functionality
> as modprobe/insmod does.

That code uses kmod_module_probe_insert_module(mod, probe_flags, NULL,
NULL, NULL, NULL) [0],
and nothe the NULL argument, because in the libkmod source [1] I just
found that:

[...]
* If @run_install is NULL, this function will fork and exec by calling
[...]

So the code is forking, and thus the race condition may happen here.

Perhaps systemd should disable the libkmod forking to have more
control of what's happening.

>
> Can we expect that the sysfs entries are available after loading the
> conntrack module?

I guess so, ifdef CONFIG_SYSCTL

[0] https://github.com/systemd/systemd/blob/master/src/modules-load/modules-load.c#L111
[1] https://github.com/lu-zero/kmod/blob/762b5d1701b7df986e0bad412c36a704fbb543b6/libkmod/libkmod-module.c#L1233




More information about the Pkg-systemd-maintainers mailing list