do not document that. -->
</listitem>
</varlistentry>
+
+ <varlistentry>
+ <term><command>enqueue-marked-jobs</command></term>
+
+ <listitem><para>Enqueue start/stop/restart/reload jobs for all units that have the respective
+ <literal>needs-*</literal> markers set. When a unit marked for reload does not support reload,
+ restart will be queued. Those properties can be set using <command>set-property Markers=…</command>.</para>
+
+ <para>Unless <option>--no-block</option> is used, <command>systemctl</command> will wait for the
+ queued jobs to finish.</para>
+
+ <xi:include href="version-info.xml" xpointer="v260"/></listitem>
+ </varlistentry>
+
<varlistentry>
<term><command>reload-or-restart <replaceable>PATTERN</replaceable>…</command></term>
{ "reload", 2, VERB_ANY, VERB_ONLINE_ONLY, verb_start },
{ "restart", 2, VERB_ANY, VERB_ONLINE_ONLY, verb_start },
{ "try-restart", 2, VERB_ANY, VERB_ONLINE_ONLY, verb_start },
+ { "enqueue-marked-jobs", 1, 1, VERB_ONLINE_ONLY, verb_start },
{ "reload-or-restart", VERB_ANY, VERB_ANY, VERB_ONLINE_ONLY, verb_start },
{ "reload-or-try-restart", 2, VERB_ANY, VERB_ONLINE_ONLY, verb_start }, /* For compatibility with old systemctl <= 228 */
{ "try-reload-or-restart", 2, VERB_ANY, VERB_ONLINE_ONLY, verb_start },
const char *method, *job_type, *mode, *one_name, *suffix = NULL;
_cleanup_free_ char **stopped_units = NULL; /* Do not use _cleanup_strv_free_ */
_cleanup_strv_free_ char **names = NULL;
+ bool is_enqueue_marked_jobs = false;
int r, ret = EXIT_SUCCESS;
sd_bus *bus;
job_type = "start";
mode = "isolate";
suffix = ".target";
- } else if (!arg_marked) {
+ } else if (streq(argv[0], "enqueue-marked-jobs") || arg_marked) {
+ is_enqueue_marked_jobs = true;
+ method = job_type = mode = NULL;
+
+ if (arg_wait)
+ return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
+ "--wait is not supported for enqueue-marked-jobs.");
+
+ if (arg_show_transaction)
+ return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
+ "--show-transaction is not supported for enqueue-marked-jobs.");
+
+ if (arg_marked)
+ log_warning("--marked is deprecated. Please use systemctl enqueue-marked-jobs instead.");
+
+ } else {
/* A command in style of "systemctl start <unit1> <unit2> …", "systemctl stop <unit1> <unit2> …" and so on */
method = verb_to_method(argv[0]);
job_type = verb_to_job_type(argv[0]);
mode = arg_job_mode();
- } else
- method = job_type = mode = NULL;
+ }
one_name = NULL;
}
names = strv_new(one_name);
if (!names)
return log_oom();
- } else if (!arg_marked) {
+ } else if (!is_enqueue_marked_jobs) {
bool expanded;
r = expand_unit_names(bus, strv_skip(argv, 1), suffix, &names, &expanded);
}
_cleanup_(fork_notify_terminate) PidRef journal_pid = PIDREF_NULL;
- if (arg_marked)
+ if (is_enqueue_marked_jobs)
ret = enqueue_marked_jobs(bus, w);
else {
if (arg_verbose)
" reload UNIT... Reload one or more units\n"
" restart UNIT... Start or restart one or more units\n"
" try-restart UNIT... Restart one or more units if active\n"
+ " enqueue-marked-jobs Enqueue all marked unit jobs\n"
" reload-or-restart UNIT... Reload one or more units if possible,\n"
" otherwise start or restart\n"
" try-reload-or-restart UNIT... If active, reload one or more units,\n"
if (optind + 1 < argc)
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"No additional arguments allowed with 'reload-or-restart --marked'.");
- if (arg_wait)
- return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
- "--marked --wait is not supported.");
- if (arg_show_transaction)
- return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
- "--marked --show-transaction is not supported.");
} else if (do_reload_or_restart) {
if (optind + 1 >= argc)