From e4c7b5f5173d92cfc5378c75fa3ab7ef0252f32b Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Tue, 26 Jan 2021 20:23:12 +0100 Subject: core: split system/user job timeouts and make them configurable Config options are -Ddefault-timeout-sec= and -Ddefault-user-timeout-sec=. Existing -Dupdate-helper-user-timeout= is renamed to -Dupdate-helper-user-timeout-sec= for consistency. All three options take an integer value in seconds. The renaming and type-change of the option is a small compat break, but it's just at compile time and result in a clear error message. I also doubt that anyone was actually using the option. This commit separates the user manager timeouts, but keeps them unchanged at 90 s. The timeout for the user manager is set to 4/3*user-timeout, which means that it is still 120 s. Fedora wants to experiment with lower timeouts, but doing this via a patch would be annoying and more work than necessary. Let's make this easy to configure. --- src/rpm/systemd-update-helper.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/rpm') diff --git a/src/rpm/systemd-update-helper.in b/src/rpm/systemd-update-helper.in index b35d952fab..c623a5ea17 100755 --- a/src/rpm/systemd-update-helper.in +++ b/src/rpm/systemd-update-helper.in @@ -32,7 +32,7 @@ case "$command" in users=$(systemctl list-units 'user@*' --legend=no | sed -n -r 's/.*user@([0-9]+).service.*/\1/p') for user in $users; do - SYSTEMD_BUS_TIMEOUT={{UPDATE_HELPER_USER_TIMEOUT}} \ + SYSTEMD_BUS_TIMEOUT={{UPDATE_HELPER_USER_TIMEOUT_SEC}}s \ systemctl --user -M "$user@" disable --now --no-warn "$@" & done wait @@ -53,7 +53,7 @@ case "$command" in users=$(systemctl list-units 'user@*' --legend=no | sed -n -r 's/.*user@([0-9]+).service.*/\1/p') for user in $users; do for unit in "$@"; do - SYSTEMD_BUS_TIMEOUT={{UPDATE_HELPER_USER_TIMEOUT}} \ + SYSTEMD_BUS_TIMEOUT={{UPDATE_HELPER_USER_TIMEOUT_SEC}}s \ systemctl --user -M "$user@" set-property "$unit" Markers=+needs-restart & done done @@ -89,7 +89,7 @@ case "$command" in if [[ "$command" =~ reexec ]]; then for user in $users; do - SYSTEMD_BUS_TIMEOUT={{UPDATE_HELPER_USER_TIMEOUT}} \ + SYSTEMD_BUS_TIMEOUT={{UPDATE_HELPER_USER_TIMEOUT_SEC}}s \ systemctl --user -M "$user@" daemon-reexec & done wait @@ -97,7 +97,7 @@ case "$command" in if [[ "$command" =~ reload ]]; then for user in $users; do - SYSTEMD_BUS_TIMEOUT={{UPDATE_HELPER_USER_TIMEOUT}} \ + SYSTEMD_BUS_TIMEOUT={{UPDATE_HELPER_USER_TIMEOUT_SEC}}s \ systemctl --user -M "$user@" daemon-reload & done wait @@ -105,7 +105,7 @@ case "$command" in if [[ "$command" =~ restart ]]; then for user in $users; do - SYSTEMD_BUS_TIMEOUT={{UPDATE_HELPER_USER_TIMEOUT}} \ + SYSTEMD_BUS_TIMEOUT={{UPDATE_HELPER_USER_TIMEOUT_SEC}}s \ systemctl --user -M "$user@" reload-or-restart --marked & done wait -- cgit v1.2.3