#1016488 openvpn: OpenVPN client prevents shutdown process.

Package:
openvpn
Source:
openvpn
Description:
virtual private network daemon
Submitter:
Jean-Marc Spaggiari
Date:
2026-10-03 13:39:02 UTC
Severity:
normal
#1016488#5
Date:
2022-08-01 17:04:15 UTC
From:
To:
Dear Maintainer,

*** Reporter, please consider answering these questions, where appropriate
***

   * What led up to the situation?

When openVPN client is connecter and tyring to shutdown the computer using
init
0 command.

   * What exactly did you do (or not do) that was effective (or
     ineffective)?

Waiting 90s gets the client killed.  However, client should not be hanging.
Issue is that network is down and client can't reconnect (expected)

   * What was the outcome of this action?
   * What outcome did you expect instead?
Client should exit quickly instead of waiting for timeout and get killed.

Here is an extract of the journalctl:
sep 07 04:39:11 t460s NetworkManager[9152]: <warn>  [1631003951.8511] device
(wlp4s0): no secrets: No ag>
sep 07 04:39:11 t460s NetworkManager[9152]: <warn>  [1631003951.8522] device
(wlp4s0): Activation: faile>
sep 07 04:39:15 t460s ovpn-client[8902]: write UDP: Network is unreachable
(code=101)
sep 07 04:39:15 t460s ovpn-client[8902]: Network unreachable, restarting
sep 07 04:39:15 t460s ovpn-client[8902]: SIGUSR1[soft,network-unreachable]
received, process restarting
sep 07 04:39:15 t460s ovpn-client[8902]: Restart pause, 300 second(s)
sep 07 04:40:38 t460s systemd[1]: session-2.scope: Stopping timed out.
Killing.

#1016488#10
Date:
2026-10-03 13:22:40 UTC
From:
To:
Thanks for discussion.


I personally suggest solving the problem by modifying the systemd configuration.Without any code changes




The essence of the problem is that during shutdown, systemd sends a SIGTERM signal to the process. The network is terminated first, and when OpenVPN detects that the network has gone down, it calls the getaddrinfo() function to translate a domain name into an IP address. At this point, the parent process needs to wait for the child process to finish, and as a result, it misses the termination signal.



The only way to solve this problem is to introduce a child process that, upon receiving SIGTERM, kills the parent process and then exits itself.


However, this kind of "watchdog" mechanism is difficult to pass in Debian.


So simply modifying the systemd configuration will do.