]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Use "new" --job-mode= option in more places
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 18 May 2015 04:58:24 +0000 (00:58 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 18 May 2015 05:08:09 +0000 (01:08 -0400)
--irreversible/--ignore-dependencies/--fail are deprececated since 4dc5b821ae737914499119e29811fc3346e3d97c.

Also add shell completions for --jobs-mode.

man/systemctl.xml
shell-completion/bash/systemctl.in
shell-completion/zsh/_systemctl.in
test/TEST-03-JOBS/test-jobs.sh
units/emergency.service.in
units/rescue.service.in

index dd9e5c571fe8439c2e2fe232245faa904398d65c..94a77bce0cd744747b34d6204ea67cd70c668323 100644 (file)
@@ -1522,7 +1522,7 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
 
           <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
@@ -1538,7 +1538,7 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
 
           <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
@@ -1554,7 +1554,7 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
 
           <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
@@ -1581,7 +1581,7 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
 
           <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
index 34c9444353315c22d3af2d74b7d6a2ac1da01a9f..c2707ba3a6ab42f3139ed222be42bbf49db3cdae 100644 (file)
@@ -90,10 +90,10 @@ _systemctl () {
         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
@@ -115,6 +115,10 @@ _systemctl () {
                                        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'
                         ;;
index cce9dea8b5ebef15f9bebcee825f2c7f9cbf4515..e123d31a72c4e8994a0a6fcd2ca4e7fb2b490196 100644 (file)
@@ -353,11 +353,18 @@ _unit_properties() {
   _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]' \
@@ -365,10 +372,7 @@ _arguments -s \
     '--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]' \
index 28368b70e4b792e3e7b45ce6bd557b5ad12fa3e0..6f32c240cd58e97c3235ba585b25845439604acb 100755 (executable)
@@ -1,6 +1,6 @@
 #!/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
@@ -11,7 +11,7 @@ grep 'hello\.service.*waiting' /root/list-jobs.txt || exit 1
 
 # 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))
 
@@ -27,7 +27,7 @@ systemctl stop sleep.service hello-after-sleep.target || exit 1
 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
 
@@ -39,7 +39,7 @@ systemctl start unstoppable.service || 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.
index 2695d7b7c97aec7aabbaddb8bc2378e5cfe7264d..52b9b1cd034b22557e918c57390a7916a8f16c6c 100644 (file)
@@ -18,7 +18,7 @@ Environment=HOME=/root
 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
index de73fee6547c2cd534e5f38980c3c2df3fa11f06..432e4f3c8458ee7dd8423248528f107d04854fea 100644 (file)
@@ -18,7 +18,7 @@ Environment=HOME=/root
 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