[systemd-devel] systemd-networkd: reload network unit from a non-root partition using a mount unit

Tom Gundersen teg at jklm.no
Wed Nov 26 12:52:48 PST 2014


Hi Matthias,

On Wed, Nov 26, 2014 at 9:40 PM, Matthias Klein
<matthias.klein at linux.com> wrote:
> I try to configure systemd 216 to boot an embedded board where the network
> configuration stays on a different partition.
> The boot should look like:
> - mount a partition called "config" using a mount unit
> - now systemd should reload its configuration to get two network units which
> resides on the "config" partition [the path /etc/systemd/network/ is linked
> to that partition]
> - on the root file system I have a wpa_supplicant@ unit for the wlan0 device
> [the wpa_supplicant.conf file for that device also resides on the "config"
> partition]
>
>
> My problem is that I can't get systemd to succesfully reload its
> configuration for my network units after mounting the "config" partition.
> I tried to to add a ExecStart systemctl daemon-reload inside the
> wpa_supplicant rule.
>
> If I have the network unit in my (read-only) root filesystem everything
> works fine. (No reloading is needed here ...)
>
>
> Is it possible to place the network untis onto a partition which is mounted
> by systemd?

This sort of scheme (mounting partitions with extra config files after
the daemons have started) is not really something we support. We would
rather recommend you mount everything you need for your base system
(i.e., all of /etc and /usr, but not necessarily /var, /home, ...)
from your initrd so that it is all there once your real userspace is
started.

That said, it _should_ just work to simply restart the relevant
services (i.e., systemd-networkd and wpa_supplicant), or better you,
just order them After= the relevant mount units (the latter will only
work if you don't need any networking before this point of course).

Please note that 'systemctl daemon-reload' only reloads the
configuration of PID1 itself, and not of the individual daemons, so
that is probably what tripped you up.

Cheers,

Tom


More information about the systemd-devel mailing list