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

Missing PID file check #447

Open
mephinet opened this issue Nov 28, 2024 · 1 comment
Open

Missing PID file check #447

mephinet opened this issue Nov 28, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@mephinet
Copy link

Describe the bug
I think I found a bug in gpclient: Unintentionally, I started "gpclient connect" while it was already running in another terminal. To my surprise, the second gpclient did not exit immediately, but created another tunnel, resulting in my network no longer being functional. I was unable to kill the two processes, and had to revert to "killall -9 gpclient" to get a working network again.

Expected behavior
From reading the log output, I know that gpclient creates a pid file:

https://github.com/yuezk/GlobalProtect-openconnect/blob/a6414533887fa3167d93b073c6308deb20ecd469/apps/gpclient/src/connect.rs#L413C10-L418C2

However, I could not find any code that checks for the existence of this pid file, and if it exists, checks whether a process with this PID is running.

Logs
in terminal 1:

[2024-11-28T09:05:46Z INFO  gpclient::cli] gpclient started: 2.3.9 (2024-11-02)
...
[2024-11-28T09:05:48Z INFO  openconnect::vpn] Connected to VPN, pipe_fd: 11
[2024-11-28T09:05:48Z INFO  gpclient::connect] Wrote PID 9290 to /var/run/gpclient.lock

in terminal 2:

[2024-11-28T09:05:56Z INFO  gpclient::cli] gpclient started: 2.3.9 (2024-11-02)
...
[2024-11-28T09:05:58Z INFO  openconnect::vpn] Connected to VPN, pipe_fd: 11
[2024-11-28T09:05:58Z INFO  gpclient::connect] Wrote PID 9954 to /var/run/gpclient.lock

Environment:

  • OS: Arch Linux
  • Desktop Environment: i3
  • /usr/bin/gnome-keyring-daemon --foreground --components=pkcs11,secrets --control-directory=/run/user/1000/keyring
  • Is remote SSH? No
@yuezk yuezk added the bug Something isn't working label Nov 30, 2024
@yuezk
Copy link
Owner

yuezk commented Nov 30, 2024

Thanks for the reporting, I will fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants