1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-11 05:17:41 +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 Ruben S. Montero
parent 68f0449f1f
commit fdebcaf2a2
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87

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