mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
TEST-07-PID1: wait for systemd-resolved being stopped
As 'systemctl stop' is called with --no-block, previously systemd-resolved
might not be stopped when 'resolvectl' is called, and the DBus connection
might be closed during the call:
```
TEST-07-PID1.sh[5643]: + systemctl stop --no-block systemd-resolved.service
TEST-07-PID1.sh[5643]: + resolvectl
TEST-07-PID1.sh[5732]: Failed to get global data: Remote peer disconnected
```
Follow-up for 8eefd0f4de.
Fixes https://github.com/systemd/systemd/pull/39388#issuecomment-3439277442.
This commit is contained in:
committed by
Luca Boccassi
parent
308d40626d
commit
6454fde83e
@@ -35,6 +35,9 @@ for i in {1..5}; do
|
||||
echo "Start #$i"
|
||||
|
||||
systemctl stop --no-block systemd-resolved.service
|
||||
# Wait for systemd-resolved in ExecStart= being stopped.
|
||||
# shellcheck disable=SC2016
|
||||
timeout 10 bash -c 'until [[ "$(systemctl show --property=MainPID --value systemd-resolved.service)" == 0 ]]; do sleep 0.1; done'
|
||||
if ! resolvectl; then
|
||||
journalctl -o short-monotonic --no-hostname --no-pager -u systemd-resolved.service -n 15
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user