1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-03-08 20:58:20 +03:00

Merge pull request #22682 from bluca/start_skip

core: do not return 'skipped' when Condition*= fail with StartUnitWithFlags()
This commit is contained in:
Luca Boccassi 2022-03-10 17:25:44 +00:00 committed by GitHub
commit a8c5363ba9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 9 deletions

4
NEWS
View File

@ -9,6 +9,10 @@ CHANGES WITH 251:
can still be used by explicitly configuring RouteTable= setting in
.netdev files.
* Jobs started via StartUnitWithFlags() will no longer return 'skipped'
when a Condition*= check does not succeed, restoring the JobRemoved
signal to the behaviour it had before v250.
* The org.freedesktop.portable1 methods GetMetadataWithExtensions and
GetImageMetadataWithExtensions have been fixed to provide an extra return
parameter, containing the actual extensions release metadata. The

View 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

View 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(

View 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(