1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

F OpenNebula/one#5178: Fix race with ssh-agent (#748)

Signed-off-by: Petr Ospalý <pospaly@opennebula.io>
This commit is contained in:
Petr Ospalý 2021-02-03 22:52:40 +01:00 committed by GitHub
parent f8ff5f7699
commit 3456cbf3a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 17 deletions

View File

@ -79,22 +79,6 @@ wait_for_memcached()
return 1
)
wait_for_ssh_agent()
(
TIMEOUT="${TIMEOUT:-120}"
while [ "$TIMEOUT" -gt 0 ] ; do
if [ -e ${SSH_AUTH_SOCK} ] ; then
return 0
fi
TIMEOUT=$(( TIMEOUT - 1 ))
sleep 1
done
return 1
)
wait_for_mysqld()
(
TIMEOUT="${TIMEOUT:-120}"

View File

@ -33,7 +33,7 @@ export SSH_AUTH_SOCK
# wait for ssh-agent socket
msg "Wait for ssh-agent (${SSH_AUTH_SOCK})..."
if ! wait_for_ssh_agent ; then
if ! wait_for_file "${SSH_AUTH_SOCK}" ; then
err "Timeout!"
exit 1
fi

View File

@ -25,6 +25,13 @@ do
fi
done
# wait for ssh-agent to start
msg "Wait for ssh-agent (/var/run/one/ssh-agent.env)..."
if ! wait_for_file "/var/run/one/ssh-agent.env" ; then
err "Timeout!"
exit 1
fi
#
# run service
#