]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
TEST-71-HOSTNAME: specify job mode for the stop job (#38413)
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 29 Jul 2025 23:25:28 +0000 (01:25 +0200)
committerGitHub <noreply@github.com>
Tue, 29 Jul 2025 23:25:28 +0000 (08:25 +0900)
The CI run is failing in the stop command:
```
[ 4841.936906] TEST-71-HOSTNAME.sh[140]: + stop_hostnamed
[ 4841.936906] TEST-71-HOSTNAME.sh[140]: + systemctl stop systemd-hostnamed.service
[ 4845.959747] TEST-71-HOSTNAME.sh[226]: Job for systemd-hostnamed.service canceled.
[ 4846.013286] systemd[1]: TEST-71-HOSTNAME.service: Main process exited, code=exited, status=1/FAILURE
[ 4846.013792] systemd[1]: TEST-71-HOSTNAME.service: Failed with result 'exit-code'.
[ 4846.021821] systemd[1]: Failed to start TEST-71-HOSTNAME.service - TEST-71-HOSTNAME.
```
This happens when we create the stop job, but while we're waiting for
it to finish, something triggers a start of the unit and we lose to competing
start job.

Hopefully fixes #36089.

test/units/TEST-71-HOSTNAME.sh

index 1ed13fe414e1f22093854eade968ce7c8047c7c7..8ec3bd6cfbf0e01951f3652f80d29bb30f0b128f 100755 (executable)
@@ -62,7 +62,7 @@ get_chassis() (
 )
 
 stop_hostnamed() {
-    systemctl stop systemd-hostnamed.service
+    systemctl stop --job-mode=replace-irreversibly systemd-hostnamed.service
     # Reset trigger limit. This might fail if the unit was unloaded already, so ignore any errors.
     systemctl reset-failed systemd-hostnamed || :
 }