diff --git a/0001-systemctl-pid1-do-not-warn-about-missing-install-inf.patch b/0001-systemctl-pid1-do-not-warn-about-missing-install-inf.patch new file mode 100644 index 00000000..8c9d10ab --- /dev/null +++ b/0001-systemctl-pid1-do-not-warn-about-missing-install-inf.patch @@ -0,0 +1,121 @@ +From b8d6cc0513adadea9b5048fa320d7f49c10f004b Mon Sep 17 00:00:00 2001 +From: Thomas Blume +Date: Wed, 4 May 2016 08:51:52 +0200 +Subject: [PATCH] systemctl,pid1: do not warn about missing install info with + "preset" + +When "preset" was executed for a unit without install info, we'd warn similarly +as for "enable" and "disable". But "preset" is usually called for all units, +because the preset files are provided by the distribution, and the units are under +control of individual programs, and it's reasonable to call "preset" for all units +rather then try to do it only for the ones that can be installed. +We also don't warn about missing info for "preset-all". Thus it seems reasonable +to silently ignore units w/o install info when presetting. + +(In addition, when more than one unit was specified, we'd issue the warning +only if none of them had install info. But this is probably something to fix +for enable/disable too.) +--- + man/systemctl.xml | 26 +++++++++++++------------- + src/systemctl/systemctl.c | 10 +++++----- + 2 files changed, 18 insertions(+), 18 deletions(-) + +diff --git a/man/systemctl.xml b/man/systemctl.xml +index f342e26..1c2c919 100644 +--- a/man/systemctl.xml ++++ b/man/systemctl.xml +@@ -1082,22 +1082,22 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service + preset NAME... + + +- Reset one or more unit files, as specified on the +- command line, to the defaults configured in the preset +- policy files. This has the same effect as +- disable or enable, +- depending how the unit is listed in the preset files. ++ Reset the enable/disable status one or more unit files, as specified on ++ the command line, to the defaults configured in the preset policy files. This ++ has the same effect as disable or ++ enable, depending how the unit is listed in the preset ++ files. + +- Use to control +- whether units shall be enabled and disabled, or only +- enabled, or only disabled. ++ Use to control whether units shall be ++ enabled and disabled, or only enabled, or only disabled. ++ ++ If the unit carries no install information, it will be silently ignored ++ by this command. + +- For more information on the preset policy format, +- see ++ For more information on the preset policy format, see + systemd.preset5. +- For more information on the concept of presets, please +- consult the Preset ++ For more information on the concept of presets, please consult the ++ Preset + document. + + +diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c +index 1f42d1a..9dc5971 100644 +--- a/src/systemctl/systemctl.c ++++ b/src/systemctl/systemctl.c +@@ -5399,6 +5399,7 @@ static int enable_unit(int argc, char *argv[], void *userdata) { + UnitFileChange *changes = NULL; + unsigned n_changes = 0; + int carries_install_info = -1; ++ bool ignore_carries_install_info = false; + int r; + + if (!argv[1]) +@@ -5412,8 +5413,7 @@ static int enable_unit(int argc, char *argv[], void *userdata) { + if (r < 0) + return r; + +- /* If the operation was fully executed by the SysV compat, +- * let's finish early */ ++ /* If the operation was fully executed by the SysV compat, let's finish early */ + if (strv_isempty(names)) + return 0; + +@@ -5430,7 +5430,6 @@ static int enable_unit(int argc, char *argv[], void *userdata) { + r = unit_file_link(arg_scope, arg_runtime, arg_root, names, arg_force, &changes, &n_changes); + else if (streq(verb, "preset")) { + r = unit_file_preset(arg_scope, arg_runtime, arg_root, names, arg_preset_mode, arg_force, &changes, &n_changes); +- carries_install_info = r; + } else if (streq(verb, "mask")) + r = unit_file_mask(arg_scope, arg_runtime, arg_root, names, arg_force, &changes, &n_changes); + else if (streq(verb, "unmask")) +@@ -5450,7 +5449,7 @@ static int enable_unit(int argc, char *argv[], void *userdata) { + } else { + _cleanup_bus_message_unref_ sd_bus_message *reply = NULL, *m = NULL; + _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; +- int expect_carries_install_info = false; ++ bool expect_carries_install_info = false; + bool send_force = true, send_preset_mode = false; + const char *method; + sd_bus *bus; +@@ -5481,6 +5480,7 @@ static int enable_unit(int argc, char *argv[], void *userdata) { + method = "PresetUnitFiles"; + + expect_carries_install_info = true; ++ ignore_carries_install_info = true; + } else if (streq(verb, "mask")) + method = "MaskUnitFiles"; + else if (streq(verb, "unmask")) { +@@ -5540,7 +5540,7 @@ static int enable_unit(int argc, char *argv[], void *userdata) { + r = 0; + } + +- if (carries_install_info == 0) ++ if (carries_install_info == 0 && !ignore_carries_install_info) + log_warning("The unit files have no [Install] section. They are not meant to be enabled\n" + "using systemctl.\n" + "Possible reasons for having this kind of units are:\n" +-- +2.6.6 + diff --git a/systemd-mini.changes b/systemd-mini.changes index 38334909..d04c8eee 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed May 4 06:37:51 UTC 2016 - Thomas.Blume@suse.com + +- fix warning about missing install info during preset (boo#970293) + 0001-systemctl-pid1-do-not-warn-about-missing-install-inf.patch + ------------------------------------------------------------------- Thu Apr 7 12:13:16 UTC 2016 - schwab@suse.de diff --git a/systemd-mini.spec b/systemd-mini.spec index 6c58354f..9a135a27 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -259,6 +259,8 @@ Patch526: systemd-228-nspawn-make-journal-linking-non-fatal-in-try-and-aut Patch527: 0001-core-fix-bus-name-synchronization-after-daemon-reloa.patch # PATCH-FIX-UPSTREAM -- fixed after 228 Patch528: 0001-core-re-sync-bus-name-list-after-deserializing-durin.patch +# PATCH-FIX-UPSTREAM -- fixed after 228 +Patch529: 0001-systemctl-pid1-do-not-warn-about-missing-install-inf.patch # UDEV PATCHES # ============ @@ -606,6 +608,7 @@ cp %{SOURCE7} m4/ %patch526 -p1 %patch527 -p1 %patch528 -p1 +%patch529 -p1 # udev patches %patch1002 -p1 diff --git a/systemd.changes b/systemd.changes index 38334909..d04c8eee 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed May 4 06:37:51 UTC 2016 - Thomas.Blume@suse.com + +- fix warning about missing install info during preset (boo#970293) + 0001-systemctl-pid1-do-not-warn-about-missing-install-inf.patch + ------------------------------------------------------------------- Thu Apr 7 12:13:16 UTC 2016 - schwab@suse.de diff --git a/systemd.spec b/systemd.spec index c2c902a1..5367c1a5 100644 --- a/systemd.spec +++ b/systemd.spec @@ -254,6 +254,8 @@ Patch526: systemd-228-nspawn-make-journal-linking-non-fatal-in-try-and-aut Patch527: 0001-core-fix-bus-name-synchronization-after-daemon-reloa.patch # PATCH-FIX-UPSTREAM -- fixed after 228 Patch528: 0001-core-re-sync-bus-name-list-after-deserializing-durin.patch +# PATCH-FIX-UPSTREAM -- fixed after 228 +Patch529: 0001-systemctl-pid1-do-not-warn-about-missing-install-inf.patch # UDEV PATCHES # ============ @@ -601,6 +603,7 @@ cp %{SOURCE7} m4/ %patch526 -p1 %patch527 -p1 %patch528 -p1 +%patch529 -p1 # udev patches %patch1002 -p1