summaryrefslogtreecommitdiffstats
path: root/src/rpm
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-01-26 20:23:12 +0100
committerLuca Boccassi <luca.boccassi@gmail.com>2023-02-01 12:52:29 +0100
commite4c7b5f5173d92cfc5378c75fa3ab7ef0252f32b (patch)
tree3c08be3d44d3b68ebe48b9a9ad8d89aa542fcc19 /src/rpm
parentbuild(deps): bump systemd/mkosi (diff)
downloadsystemd-e4c7b5f5173d92cfc5378c75fa3ab7ef0252f32b.tar.xz
systemd-e4c7b5f5173d92cfc5378c75fa3ab7ef0252f32b.zip
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.
Diffstat (limited to 'src/rpm')
-rwxr-xr-xsrc/rpm/systemd-update-helper.in10
1 files changed, 5 insertions, 5 deletions
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