mirror of
https://github.com/angristan/openvpn-install.git
synced 2025-12-16 08:57:03 +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: |
|
||||
echo "Waiting for OpenVPN server to install and start..."
|
||||
for i in {1..60}; do
|
||||
# Use pgrep -x to match exactly "openvpn" process, not "apt-get install openvpn"
|
||||
if docker exec openvpn-server pgrep -x openvpn > /dev/null 2>&1; then
|
||||
# Use pgrep -f to match openvpn running with server.conf, not transient
|
||||
# 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!"
|
||||
break
|
||||
fi
|
||||
@@ -111,7 +112,7 @@ jobs:
|
||||
done
|
||||
|
||||
# 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"
|
||||
docker logs openvpn-server
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user