1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-02-27 13:57:23 +03:00

B #-: Cleanup ssh-agent socket before starting (#2413)

When (for whatever reason) opennebula-ssh-agent gets killed
it leaves existing socket and following start fails with

opennebula-ssh-agent[2333]: unix_listener: cannot bind to path /var/run/one/ssh-agent.sock: Address already in use
This commit is contained in:
Jan Orel 2022-12-09 16:22:11 +01:00 committed by GitHub
parent c17e0bcf1b
commit f002812c9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,7 +8,7 @@ Group=oneadmin
User=oneadmin
Environment=SSH_AUTH_SOCK=/var/run/one/ssh-agent.sock
# ssh-agent is executed via shell wrapper to workaround a SELinux issue
ExecStartPre=/bin/sh -c "echo SSH_AUTH_SOCK=$SSH_AUTH_SOCK > /var/run/one/ssh-agent.env"
ExecStartPre=/bin/sh -c "echo SSH_AUTH_SOCK=$SSH_AUTH_SOCK > /var/run/one/ssh-agent.env; rm -f $SSH_AUTH_SOCK"
ExecStart=/bin/sh -c "exec /usr/bin/ssh-agent -a $SSH_AUTH_SOCK"
ExecStartPost=-/bin/sh -c "/usr/bin/ssh-add"
ExecStopPost=/usr/bin/rm -f /var/run/one/ssh-agent.env