]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: do not return 'skipped' when Condition*= fail with StartUnitWithFlags()
authorLuca Boccassi <bluca@debian.org>
Tue, 8 Mar 2022 22:13:37 +0000 (22:13 +0000)
committerLuca Boccassi <bluca@debian.org>
Thu, 10 Mar 2022 13:16:21 +0000 (13:16 +0000)
Backward incompatible change to avoid returning 'skipped' if a condition causes
a job activation to be skipped when using StartUnitWithFlags().
Job results are broadcasted, so it is theoretically possible that existing
software could get confused if they see this result.

Replaces https://github.com/systemd/systemd/pull/22369

man/org.freedesktop.systemd1.xml
src/core/dbus-unit.c
src/core/dbus-unit.h

index 5f1f586222c66e52fbf81ee00889633588b540ed..d47d916b76e3cedfbcb1306e195eb44298ffbcc5 100644 (file)
@@ -1206,10 +1206,7 @@ node /org/freedesktop/systemd1 {
 
       <para><function>StartUnitWithFlags()</function> is similar to <function>StartUnit()</function> but
       allows the caller to pass an extra <varname>flags</varname> parameter, which does not support any
-      flags for now, and is reserved for future extensions. The new method also changes the behaviour
-      of the <varname>JobRemoved</varname> signal and make it return <literal>skipped</literal> in case
-      the unit activation job is skipped because a <varname>Condition*=</varname> is not satisfied.
-      With the <varname>StartUnit</varname> method, <literal>done</literal> would be returned instead.</para>
+      flags for now, and is reserved for future extensions.</para>
 
       <para><function>StopUnit()</function> is similar to <function>StartUnit()</function> but stops the
       specified unit rather than starting it. Note that the <literal>isolate</literal> mode is invalid for this
index 1e012416762b0b709482c6d1b310af60a679394d..6542d50330fa6e1edd73cf2194f72856573805da 100644 (file)
@@ -417,10 +417,6 @@ int bus_unit_method_start_generic(
                         return sd_bus_reply_method_errorf(message, SD_BUS_ERROR_INVALID_ARGS,
                                                           "Invalid 'flags' parameter '%" PRIu64 "'",
                                                           input_flags);
-
-                /* The new method unconditionally uses the new behaviour of returning 'skip' when
-                 * a job is skipped. */
-                job_flags |= BUS_UNIT_QUEUE_RETURN_SKIP_ON_CONDITION_FAIL;
         }
 
         r = bus_verify_manage_units_async_full(
index ccb379cee5501fa023b8ab455b54e9c76ca9a5ba..ab7787ce46618861ed14634386956db159e14879 100644 (file)
@@ -31,7 +31,7 @@ int bus_unit_method_thaw(sd_bus_message *message, void *userdata, sd_bus_error *
 typedef enum BusUnitQueueFlags {
         BUS_UNIT_QUEUE_RELOAD_IF_POSSIBLE            = 1 << 0,
         BUS_UNIT_QUEUE_VERBOSE_REPLY                 = 1 << 1,
-        BUS_UNIT_QUEUE_RETURN_SKIP_ON_CONDITION_FAIL = 1 << 2,
+        BUS_UNIT_QUEUE_RETURN_SKIP_ON_CONDITION_FAIL = 1 << 2, // FIXME: currently not used, will be changed soon
 } BusUnitQueueFlags;
 
 int bus_unit_queue_job_one(