[systemd-commits] man/systemctl.xml shell-completion/bash shell-completion/zsh test/TEST-03-JOBS units/emergency.service.in units/rescue.service.in

Zbigniew Jędrzejewski-Szmek zbyszek at kemper.freedesktop.org
Sun May 17 22:08:32 PDT 2015


 man/systemctl.xml                  |    8 ++++----
 shell-completion/bash/systemctl.in |    8 ++++++--
 shell-completion/zsh/_systemctl.in |   12 ++++++++----
 test/TEST-03-JOBS/test-jobs.sh     |    8 ++++----
 units/emergency.service.in         |    2 +-
 units/rescue.service.in            |    2 +-
 6 files changed, 24 insertions(+), 16 deletions(-)

New commits:
commit 903e7c37caaaedf8ab0b6c664f4946cce369c0f0
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Mon May 18 00:58:24 2015 -0400

    Use "new" --job-mode= option in more places
    
    --irreversible/--ignore-dependencies/--fail are deprececated since 4dc5b821ae737914499119e29811fc3346e3d97c.
    
    Also add shell completions for --jobs-mode.

diff --git a/man/systemctl.xml b/man/systemctl.xml
index dd9e5c5..94a77bc 100644
--- a/man/systemctl.xml
+++ b/man/systemctl.xml
@@ -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
diff --git a/shell-completion/bash/systemctl.in b/shell-completion/bash/systemctl.in
index 34c9444..c2707ba 100644
--- a/shell-completion/bash/systemctl.in
+++ b/shell-completion/bash/systemctl.in
@@ -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'
                         ;;
diff --git a/shell-completion/zsh/_systemctl.in b/shell-completion/zsh/_systemctl.in
index cce9dea..e123d31 100644
--- a/shell-completion/zsh/_systemctl.in
+++ b/shell-completion/zsh/_systemctl.in
@@ -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]' \
diff --git a/test/TEST-03-JOBS/test-jobs.sh b/test/TEST-03-JOBS/test-jobs.sh
index 28368b7..6f32c24 100755
--- a/test/TEST-03-JOBS/test-jobs.sh
+++ b/test/TEST-03-JOBS/test-jobs.sh
@@ -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.
diff --git a/units/emergency.service.in b/units/emergency.service.in
index 2695d7b..52b9b1c 100644
--- a/units/emergency.service.in
+++ b/units/emergency.service.in
@@ -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
diff --git a/units/rescue.service.in b/units/rescue.service.in
index de73fee..432e4f3 100644
--- a/units/rescue.service.in
+++ b/units/rescue.service.in
@@ -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



More information about the systemd-commits mailing list