Skip to content
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

Socket should be deleted on application exit #34

Open
lucasvc opened this issue Feb 19, 2020 · 5 comments
Open

Socket should be deleted on application exit #34

lucasvc opened this issue Feb 19, 2020 · 5 comments

Comments

@lucasvc
Copy link

lucasvc commented Feb 19, 2020

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.

@h4de5
Copy link

h4de5 commented Mar 10, 2020

try --force option. an existing socket will be overwriten.

@lucasvc
Copy link
Author

lucasvc commented Mar 11, 2020

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)

@ferenczy
Copy link

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.

@ferenczy
Copy link

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.

@benpye benpye changed the title Computer shutdown kills the application and leaving the socket behind Socket should be deleted on application exit Nov 21, 2020
@intelfx
Copy link

intelfx commented Oct 6, 2021

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants