wsl-ssh-pageant
wsl-ssh-pageant copied to clipboard
Socket should be deleted on application exit
I have a shortcut on my shell:startup
to open Pageant with my key and after start wsl-ssh-pageant
using WSL socket:
"C:\Program Files\PuTTY\pageant.exe" "C:\Users\lucsavc\lucsavc.ppk" -c "C:\Users\lucsavc\software\wsl-ssh-pageant\wsl-ssh-pageant-amd64-gui.exe" --systray --wsl "%TMPDIR%\wsl-ssh-pageant.sock"
When shuting down the computer normally, seems that systray application is not stopped and the socket file is left there. So next start, application won't start as socket is already there.
try --force
option. an existing socket will be overwriten.
Thanks, works like a charm. Btw, that flag is not in the README :) (I will leave open if you want to add it or so)
I just also noticed this issue. A combination of this issue and #35 is that it's permanently not working and the user is not exactly sure why.
It would be good to have the option --force
in the documentation and also to produce an error message (both on the console and as a GUI dialog) in case --force
is not used and a socket file already exists.
BTW the --force
option shouldn't be needed during a regular usage of the application. It's good to have it in case the application or the operating system have crashed before, so I don't have to manually delete the socket file, but an issue to fix in the first place is that the socket file is not being deleted during a successful shutdown, I would say.
but an issue to fix in the first place is that the socket file is not being deleted during a successful shutdown, I would say
Honestly, not really.
As you correctly note, the OS and/or the computer might crash at any moment, leaving no chance for cleanup actions to run. Any background service is expected to deal with such issues automatically. The user should not be required to check up on his/her services and babysit them after each unclean shutdown.
This means that --force
should be default and the only behavior (with an added check to prevent multiple living instances fighting over the same socket).