After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 775165 - consider using SIGINT to stop openconnect on disconnect
consider using SIGINT to stop openconnect on disconnect
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: VPN: openconnect
git master
Other Linux
: Normal enhancement
: ---
Assigned To: David Woodhouse
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2016-11-27 02:19 UTC by Mike Miller
Modified: 2017-07-11 09:48 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Mike Miller 2016-11-27 02:19:19 UTC
Consider using SIGINT rather than SIGTERM to stop the openconnect process from the nm-openconnect-service. OpenConnect exits immediately on SIGTERM, but does a controlled shutdown on SIGINT.

Something like the following (untested):

diff --git a/src/nm-openconnect-service.c b/src/nm-openconnect-service.c
index dc82a9f..85093b2 100644
--- a/src/nm-openconnect-service.c
+++ b/src/nm-openconnect-service.c
@@ -603,7 +603,7 @@ real_disconnect (NMVpnServicePlugin   *plugin,
        NMOpenconnectPluginPrivate *priv = NM_OPENCONNECT_PLUGIN_GET_PRIVATE (plugin);
 
        if (priv->pid) {
-               if (kill (priv->pid, SIGTERM) == 0)
+               if (kill (priv->pid, SIGINT) == 0)
                        g_timeout_add (2000, ensure_killed, GINT_TO_POINTER (priv->pid));
                else
                        kill (priv->pid, SIGKILL);
---

Forwarded from the Debian BTS: https://bugs.debian.org/820892
Comment 1 Luca Boccassi 2017-07-06 20:17:04 UTC
Ping! This patch works fine on Debian 9.
Any chance a Network Manager maintainer could have a look? Thanks!
Comment 2 Lubomir Rintel 2017-07-11 09:48:05 UTC
(In reply to Mike Miller from comment #0)
> Consider using SIGINT rather than SIGTERM to stop the openconnect process
> from the nm-openconnect-service. OpenConnect exits immediately on SIGTERM,
> but does a controlled shutdown on SIGINT.

Thank you, the patch looks correct. Applied.