TEST-71-HOSTNAME: specify job mode for the stop job (#38413)

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.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2025-07-30 01:25:28 +02:00
committed by GitHub
parent 0140f26046
commit 57fbe401f5

View File

@@ -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 || :
}