-
-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reuse of auth sock across multiple instances #3
Comments
It's not supposed to work with multiple instances running, and I want it to be easy to set a single environment variable and have it work in all terminals. The ssh-agent default of only configuring the current shell seems so backwards to me. I'd be happy for it to exit with an error at startup if the socket is still being listened on, but if it's just a dangling file I want it to get deleted. Is there a better way to tell if the socket is being listened on than trying to connect to it? |
I don't know. Could encode pid in the filename and check if that pid is still running… On the other hand, arguably this should be launched by launchd/systemd not by opening from a shell (rc)? So perhaps it won't be a problem to replace the socket always and instead maybe just print usage if no arguments (pass some argument in the unit file). I wonder if both systemd and launchd will actually listen for the unix socket for us - or is it easier to listen ourselves? That would also bypass the whole problem. Perhaps better to come back to this after those are implemented. |
Oh that's a good idea. We should definitely encourage launchd/systemd management, it's a better UX. |
We settled on single instance and removing the socket. |
I watched the Twitch stream after the fact. You were considering the auth sock name… The usual ssh agent uses its pid in the unix socket file name, which avoids conflicts in case of multiple instances.
If yubikey-agent is supposed to work with multiple instances of it running, it should probably do something similar, and PID is probably reasonable for this?
If it's not supposed to work with multiple instances running, it should probably fail startup with error. It does not do that currently.
The text was updated successfully, but these errors were encountered: