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

fix(ns-plug): restarting ns-plug indefinetly #1104

Merged
merged 5 commits into from
Mar 5, 2025
Merged

fix(ns-plug): restarting ns-plug indefinetly #1104

merged 5 commits into from
Mar 5, 2025

Conversation

Tbaile
Copy link
Contributor

@Tbaile Tbaile commented Mar 3, 2025

In case of something breaking (loss of connection or upstream server not available), restart ns-plug every 5 minutes to try and revive the process.

This needs to be tested even before merging for the following:

  • Firewall connection loss
  • Controller offline / not available
  • Turn on/off ns-plug service (by removing the controller assignation and adding it back again)

Ref:

@Tbaile Tbaile requested a review from gsanchietti March 3, 2025 13:22
Copy link
Member

@gsanchietti gsanchietti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The feature does not work as expected.

If the VPN connection is terminated because the controller is not reachable, the client enters in a loop state:

Mar  5 13:23:54 NethSec ns-plug[11742]: 2025-03-05 13:23:54 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
Mar  5 13:23:54 NethSec ns-plug[11742]: 2025-03-05 13:23:54 TCP/UDP: Preserving recently used remote address: [AF_INET]206.189.3.76:20001
Mar  5 13:23:54 NethSec ns-plug[11742]: 2025-03-05 13:23:54 Socket Buffers: R=[212992->212992] S=[212992->212992]
Mar  5 13:23:54 NethSec ns-plug[11742]: 2025-03-05 13:23:54 UDPv4 link local: (not bound)
Mar  5 13:23:54 NethSec ns-plug[11742]: 2025-03-05 13:23:54 UDPv4 link remote: [AF_INET]206.189.3.76:20001
Mar  5 13:23:54 NethSec ns-plug[11742]: 2025-03-05 13:23:54 read UDPv4 [ECONNREFUSED]: Connection refused (fd=3,code=111)
Mar  5 13:23:57 NethSec ns-plug[11742]: 2025-03-05 13:23:57 read UDPv4 [ECONNREFUSED]: Connection refused (fd=3,code=111)
Mar  5 13:23:59 NethSec ns-plug[11742]: 2025-03-05 13:23:59 Server poll timeout, restarting
Mar  5 13:23:59 NethSec ns-plug[11742]: 2025-03-05 13:23:59 SIGUSR1[soft,server_poll] received, process restarting
Mar  5 13:23:59 NethSec ns-plug[11742]: 2025-03-05 13:23:59 WARNING: No server certificate verification method has been enabled.  See http://openvpn.net/howto.html#mitm for more info.
Mar  5 13:23:59 NethSec ns-plug[11742]: 2025-03-05 13:23:59 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
Mar  5 13:23:59 NethSec ns-plug[11742]: 2025-03-05 13:23:59 TCP/UDP: Preserving recently used remote address: [AF_INET]206.189.3.76:20001
Mar  5 13:23:59 NethSec ns-plug[11742]: 2025-03-05 13:23:59 Socket Buffers: R=[212992->212992] S=[212992->212992]
Mar  5 13:23:59 NethSec ns-plug[11742]: 2025-03-05 13:23:59 UDPv4 link local: (not bound)
Mar  5 13:23:59 NethSec ns-plug[11742]: 2025-03-05 13:23:59 UDPv4 link remote: [AF_INET]206.189.3.76:20001
Mar  5 13:23:59 NethSec ns-plug[11742]: 2025-03-05 13:23:59 read UDPv4 [ECONNREFUSED]: Connection refused (fd=3,code=111)
Mar  5 13:24:01 NethSec ns-plug[11742]: 2025-03-05 13:24:01 read UDPv4 [ECONNREFUSED]: Connection refused (fd=3,code=111)

If the VPN is not connected and controller it's not reachable, the ns-plug exists with 5 and procd does not restart it.

@Tbaile
Copy link
Contributor Author

Tbaile commented Mar 5, 2025

restart -> respawn

My bad.

@Tbaile Tbaile requested a review from gsanchietti March 5, 2025 14:16
@Tbaile Tbaile merged commit 091435f into main Mar 5, 2025
1 check passed
@Tbaile Tbaile deleted the issue-1084 branch March 5, 2025 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants