]> 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)
committerLuca Boccassi <luca.boccassi@gmail.com>
Mon, 4 Aug 2025 15:50:29 +0000 (16:50 +0100)
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.

(cherry picked from commit 57fbe401f5ef03af503a10e9c3339d646fb84dd3)

test/units/TEST-71-HOSTNAME.sh

index 0fae941a75e7aee32a183a00d01fcaf5c454f0bb..fc412edae5769c7fbfab2b33c6706b917c652546 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 || :
 }