mirror of
https://github.com/angristan/openvpn-install.git
synced 2025-12-16 17:07:02 +01:00
fix: use pgrep -f to detect OpenVPN server, not transient processes
The previous check using `pgrep -x openvpn` was matching transient openvpn processes like `openvpn --genkey` that run during installation, causing false positives. This led to race conditions where the CI thought the server was running when it was actually still installing. Use `pgrep -f "openvpn.*server.conf"` to specifically match the actual OpenVPN server process running with the server configuration.
This commit is contained in:
committed by
Stanislas
parent
6cca56f5b5
commit
d9e11822db
7
.github/workflows/docker-test.yml
vendored
7
.github/workflows/docker-test.yml
vendored
@@ -99,8 +99,9 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "Waiting for OpenVPN server to install and start..."
|
echo "Waiting for OpenVPN server to install and start..."
|
||||||
for i in {1..60}; do
|
for i in {1..60}; do
|
||||||
# Use pgrep -x to match exactly "openvpn" process, not "apt-get install openvpn"
|
# Use pgrep -f to match openvpn running with server.conf, not transient
|
||||||
if docker exec openvpn-server pgrep -x openvpn > /dev/null 2>&1; then
|
# processes like "openvpn --genkey" that run during installation
|
||||||
|
if docker exec openvpn-server pgrep -f "openvpn.*server.conf" > /dev/null 2>&1; then
|
||||||
echo "OpenVPN server is running!"
|
echo "OpenVPN server is running!"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
@@ -111,7 +112,7 @@ jobs:
|
|||||||
done
|
done
|
||||||
|
|
||||||
# Final check
|
# Final check
|
||||||
if ! docker exec openvpn-server pgrep -x openvpn > /dev/null 2>&1; then
|
if ! docker exec openvpn-server pgrep -f "openvpn.*server.conf" > /dev/null 2>&1; then
|
||||||
echo "ERROR: OpenVPN server failed to start"
|
echo "ERROR: OpenVPN server failed to start"
|
||||||
docker logs openvpn-server
|
docker logs openvpn-server
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user