From: Luca Boccassi Date: Tue, 8 Mar 2022 22:13:37 +0000 (+0000) Subject: core: do not return 'skipped' when Condition*= fail with StartUnitWithFlags() X-Git-Tag: v251-rc1~176^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ee3ae55e7537c716530b293c91f3fb9ae22a8049;p=thirdparty%2Fsystemd.git core: do not return 'skipped' when Condition*= fail with StartUnitWithFlags() 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 --- diff --git a/man/org.freedesktop.systemd1.xml b/man/org.freedesktop.systemd1.xml index 5f1f586222c..d47d916b76e 100644 --- a/man/org.freedesktop.systemd1.xml +++ b/man/org.freedesktop.systemd1.xml @@ -1206,10 +1206,7 @@ node /org/freedesktop/systemd1 { StartUnitWithFlags() is similar to StartUnit() but allows the caller to pass an extra flags parameter, which does not support any - flags for now, and is reserved for future extensions. The new method also changes the behaviour - of the JobRemoved signal and make it return skipped in case - the unit activation job is skipped because a Condition*= is not satisfied. - With the StartUnit method, done would be returned instead. + flags for now, and is reserved for future extensions. StopUnit() is similar to StartUnit() but stops the specified unit rather than starting it. Note that the isolate mode is invalid for this diff --git a/src/core/dbus-unit.c b/src/core/dbus-unit.c index 1e012416762..6542d50330f 100644 --- a/src/core/dbus-unit.c +++ b/src/core/dbus-unit.c @@ -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( diff --git a/src/core/dbus-unit.h b/src/core/dbus-unit.h index ccb379cee55..ab7787ce466 100644 --- a/src/core/dbus-unit.h +++ b/src/core/dbus-unit.h @@ -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(