1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-23 17:34:00 +03:00
systemd-stable/test/units/testsuite-51.sh
Luca Boccassi abb99360d3 core: do not restart a service with Restart=always when ExecCondition fails
When a Condition*= fails, and a service has Restart=always,
the service is not restarted.
Follow the same behaviour for ExecCondition= to avoid inconsistencies.

Fixes #22257
2022-01-26 19:02:11 +00:00

16 lines
494 B
Bash
Executable File

#!/usr/bin/env bash
# SPDX-License-Identifier: LGPL-2.1-or-later
set -eux
set -o pipefail
systemctl start testsuite-51-repro-1
systemctl start testsuite-51-repro-2
systemctl start testsuite-51-repro-3
sleep 5 # wait a bit in case there are restarts so we can count them below
[[ "$(systemctl show testsuite-51-repro-1 -P NRestarts)" == "0" ]]
[[ "$(systemctl show testsuite-51-repro-2 -P NRestarts)" == "0" ]]
[[ "$(systemctl show testsuite-51-repro-3 -P NRestarts)" == "0" ]]
touch /testok