<listitem>
<para>Shut down and halt the system. This is mostly equivalent to
- <command>start halt.target --irreversible</command>, but also
+ <command>start halt.target --job-mode=replace-irreversibly</command>, but also
prints a wall message to all users. If combined with
<option>--force</option>, shutdown of all running services is
skipped, however all processes are killed and all file
<listitem>
<para>Shut down and power-off the system. This is mostly
- equivalent to <command>start poweroff.target --irreversible</command>,
+ equivalent to <command>start poweroff.target --job-mode=replace-irreversibly</command>,
but also prints a wall message to all users. If combined with
<option>--force</option>, shutdown of all running services is
skipped, however all processes are killed and all file
<listitem>
<para>Shut down and reboot the system. This is mostly
- equivalent to <command>start reboot.target --irreversible</command>,
+ equivalent to <command>start reboot.target --job-mode=replace-irreversibly</command>,
but also prints a wall message to all users. If combined with
<option>--force</option>, shutdown of all running services is
skipped, however all processes are killed and all file
<listitem>
<para>Shut down and reboot the system via kexec. This is
- mostly equivalent to <command>start kexec.target --irreversible</command>,
+ mostly equivalent to <command>start kexec.target --job-mode=replace-irreversibly</command>,
but also prints a wall message to all users. If combined
with <option>--force</option>, shutdown of all running
services is skipped, however all processes are killed and
local i verb comps mode
local -A OPTS=(
- [STANDALONE]='--all -a --reverse --after --before --defaults --fail --ignore-dependencies --failed --force -f --full -l --global
+ [STANDALONE]='--all -a --reverse --after --before --defaults --failed --force -f --full -l --global
--help -h --no-ask-password --no-block --no-legend --no-pager --no-reload --no-wall
--quiet -q --privileged -P --system --user --version --runtime --recursive -r --firmware-setup'
- [ARG]='--host -H --kill-who --property -p --signal -s --type -t --state --root'
+ [ARG]='--host -H --kill-who --property -p --signal -s --type -t --state --job-mode --root'
)
if __contains_word "--user" ${COMP_WORDS[*]}; then
active inactive
dead elapsed exited listening mounted plugged running waiting'
;;
+ --job-mode)
+ comps='fail replace replace-irreversibly isolate
+ ignore-dependencies ignore-requirements flush'
+ ;;
--kill-who)
comps='all control main'
;;
_values -s , "${_sys_all_properties[@]}"
}
+_job_modes() {
+ local -a _modes
+ _modes=(fail replace replace-irreversibly isolate ignore-dependencies ignore-requirements flush)
+ _values -s , "${_modes[@]}"
+}
+
_arguments -s \
{-h,--help}'[Show help]' \
'--version[Show package version]' \
{-t+,--type=}'[List only units of a particular type]:unit type:_unit_types' \
- '--state=[Display units in the specifyied state]:unit state:_unit_states' \
+ '--state=[Display units in the specified state]:unit state:_unit_states' \
+ '--job-mode=[Specify how to deal with other jobs]:mode:_job_modes' \
{-p+,--property=}'[Show only properties by specific name]:unit property:_unit_properties' \
{-a,--all}'[Show all units/properties, including dead/empty ones]' \
'--reverse[Show reverse dependencies]' \
'--before[Show units ordered before]' \
'--failed[Show only failed units]' \
{-l,--full}"[Don't ellipsize unit names on output]" \
- '--fail[When queueing a new job, fail if conflicting jobs are pending]' \
'--show-types[When showing sockets, show socket type]' \
- '--irreversible[Mark transactions as irreversible]' \
- '--ignore-dependencies[When queueing a new job, ignore all its dependencies]' \
{-i,--ignore-inhibitors}'[When executing a job, ignore jobs dependencies]' \
{-q,--quiet}'[Suppress output]' \
'--no-block[Do not wait until operation finished]' \
#!/bin/bash -x
-# Test merging of a --ignore-dependencies job into a previously
+# Test merging of a --job-mode=ignore-dependencies job into a previously
# installed job.
systemctl start --no-block hello-after-sleep.target
# This is supposed to finish quickly, not wait for sleep to finish.
START_SEC=$(date -u '+%s')
-systemctl start --ignore-dependencies hello
+systemctl start --job-mode=ignore-dependencies hello
END_SEC=$(date -u '+%s')
ELAPSED=$(($END_SEC-$START_SEC))
systemctl start --no-block hello-after-sleep.target || exit 1
# hello.service should still be waiting, so these try-restarts will collapse
# into NOPs.
-systemctl try-restart --fail hello.service || exit 1
+systemctl try-restart --job-mode=fail hello.service || exit 1
systemctl try-restart hello.service || exit 1
systemctl stop hello.service sleep.service hello-after-sleep.target || exit 1
# This is expected to fail with 'job cancelled'
systemctl stop unstoppable.service && exit 1
# But this should succeed
-systemctl stop --irreversible unstoppable.service || exit 1
+systemctl stop --job-mode=replace-irreversibly unstoppable.service || exit 1
# We're going to shutdown soon. Let's see if it succeeds when
# there's an active service that tries to be unstoppable.
WorkingDirectory=/root
ExecStartPre=-/bin/plymouth quit
ExecStartPre=-/bin/echo -e 'Welcome to emergency mode! After logging in, type "journalctl -xb" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" or ^D to\\ntry again to boot into default mode.'
-ExecStart=-/bin/sh -c "@SULOGIN@; @SYSTEMCTL@ --fail --no-block default"
+ExecStart=-/bin/sh -c "@SULOGIN@; @SYSTEMCTL@ --job-mode=fail --no-block default"
Type=idle
StandardInput=tty-force
StandardOutput=inherit
WorkingDirectory=/root
ExecStartPre=-/bin/plymouth quit
ExecStartPre=-/bin/echo -e 'Welcome to emergency mode! After logging in, type "journalctl -xb" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" or ^D to\\nboot into default mode.'
-ExecStart=-/bin/sh -c "@SULOGIN@; @SYSTEMCTL@ --fail --no-block default"
+ExecStart=-/bin/sh -c "@SULOGIN@; @SYSTEMCTL@ --job-mode=fail --no-block default"
Type=idle
StandardInput=tty-force
StandardOutput=inherit