Le mercredi 24 août 2011 à 13:42 +0200, Frederic Crozat a écrit : > Le mardi 23 août 2011 à 17:56 +0200, Lennart Poettering a écrit : > > On Mon, 22.08.11 17:52, Frederic Crozat (fcro...@suse.com) wrote: > > > > > Hi, > > > > > > I'm testing a systemd-generator to create default.target symlink, > > > depending on /etc/inittab content. > > > > > > Generator is working fine, creating symlink in /run/systemd/generator > > > but systemd isn't noticing the file (it is still using default.target > > > from /lib/systemd/system/ ) until systemctl daemon-reload is started. > > > > > > Sounds like a bug but I'm not sure where it is.. > > > > Hmm, I am a bit confused. A reload of systemd will cause the generators > > to be run, so yupp, they should be applied in that case. > > > > Maybe your generator does not work properly during the early boot phase > > since it requires file systems or services which aren't around yet? > > > > Generators are executed very very early, and can only access data from > > the root fs, not even /usr. Hence writing them in anything but C is not > > really an option. > > After digging further, I found the issue : > - generators was not at fault > - unlike what I was thinking, /run/systemd/generator doesn't take > precedence over /lib, so it couldn't work > - but /run/systemd/system is supposed to take precedence over everything > (/lib and /etc). > > I've adapted my generator to only create the file in /run/systemd/system > if there was none in /etc/systemd/system. > > It didn't work as expected due to a bug in > path-lookup.c:lookup_paths_init which remove from the lookup path lists > empty directories : therefore /run/systemd/system was evicted from the > directory list to monitor and wasn't used at all. > > This was added by commit a9dd208208e672a4fe5a3c2405946c1506e034db and it > should be reverted.
To be more precise, attached part should be committed (only revert one part of the commit). -- Frederic Crozat <fcro...@suse.com> SUSE
>From 3d2d9f22aecb1e1631bd51bc6252bf8813506af5 Mon Sep 17 00:00:00 2001 From: Frederic Crozat <fcro...@suse.com> Date: Wed, 24 Aug 2011 13:52:47 +0200 Subject: [PATCH] path-lookup: don't remove empty directories. They might be populated by generator. --- src/path-lookup.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/src/path-lookup.c b/src/path-lookup.c index 5f5ad8c..7f8b0cb 100644 --- a/src/path-lookup.c +++ b/src/path-lookup.c @@ -240,7 +240,6 @@ int lookup_paths_init(LookupPaths *p, ManagerRunningAs running_as, bool personal return -ENOMEM; strv_uniq(p->unit_path); - strv_path_remove_empty(p->unit_path); if (!strv_isempty(p->unit_path)) { -- 1.7.3.4
_______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel