]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: Execute first boot presets in an enable-only preset-mode.
authorDimitri John Ledkov <dimitri.j.ledkov@intel.com>
Fri, 15 May 2015 10:44:22 +0000 (11:44 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 15 May 2015 10:49:33 +0000 (12:49 +0200)
This means any existing enabled units well be preserved and no
pre-created symlinks will be removed. This is done on first boot, when
the assumption is that /etc is not populated at all (no machine-id
setup). For minimal containers that gives a significant first boot
speed up, approximately ~20ms / ~16% in my trials.

TODO
src/core/main.c

diff --git a/TODO b/TODO
index 932fef64311cd761dfb3ad5a817fb55d7b638c66..dd85f574734577311ccd7faa9902fd8e00915364 100644 (file)
--- a/TODO
+++ b/TODO
@@ -149,10 +149,6 @@ Features:
   that are not supported...
   http://lists.freedesktop.org/archives/systemd-devel/2015-February/028076.html
 
-* PID 1: when invoking systemctl preset-all on first boots, operate in
-  an exclusively additive way, i.e. never remove any pre-existing
-  symlinks, only add new ones.
-
 * Introduce $LISTEN_NAMES to complement $LISTEN_FDS, containing a
   colon separated list of identifiers for the fds passed.
 
index 08e84d8304330e7043570a29768eee33bf0b7ca6..c39815b106750aba60a17beaeefed38521d7efc5 100644 (file)
@@ -1618,7 +1618,7 @@ int main(int argc, char *argv[]) {
                 bump_rlimit_nofile(&saved_rlimit_nofile);
 
                 if (empty_etc) {
-                        r = unit_file_preset_all(UNIT_FILE_SYSTEM, false, NULL, UNIT_FILE_PRESET_FULL, false, NULL, 0);
+                        r = unit_file_preset_all(UNIT_FILE_SYSTEM, false, NULL, UNIT_FILE_PRESET_ENABLE_ONLY, false, NULL, 0);
                         if (r < 0)
                                 log_warning_errno(r, "Failed to populate /etc with preset unit settings, ignoring: %m");
                         else