mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-10 22:10:17 +01:00
2008-05-22 Tambet Ingo <tambet@gmail.com>
* src/nm-vpnc-service.c (real_disconnect): If sending SIGTERM succeeds, add a timeout to make sure it gets killed. If it fails, send SIGKILL immediately. * src/nm-openvpn-service.c (real_disconnect): If sending SIGTERM succeeds, add a timeout to make sure it gets killed. If it fails, send SIGKILL immediately. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3682 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
55f9c72b42
commit
3fd52df04f
4 changed files with 46 additions and 4 deletions
|
|
@ -1,3 +1,9 @@
|
|||
2008-05-22 Tambet Ingo <tambet@gmail.com>
|
||||
|
||||
* src/nm-openvpn-service.c (real_disconnect): If sending SIGTERM
|
||||
succeeds, add a timeout to make sure it gets killed. If it fails,
|
||||
send SIGKILL immediately.
|
||||
|
||||
2008-05-01 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* src/nm-vpnc-service.c
|
||||
|
|
|
|||
|
|
@ -710,13 +710,28 @@ real_need_secrets (NMVPNPlugin *plugin,
|
|||
}
|
||||
|
||||
static gboolean
|
||||
real_disconnect (NMVPNPlugin *plugin,
|
||||
GError **err)
|
||||
ensure_killed (gpointer data)
|
||||
{
|
||||
int pid = GPOINTER_TO_INT (data);
|
||||
|
||||
if (kill (pid, 0) == 0)
|
||||
kill (pid, SIGKILL);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
real_disconnect (NMVPNPlugin *plugin,
|
||||
GError **err)
|
||||
{
|
||||
NMOpenvpnPluginPrivate *priv = NM_OPENVPN_PLUGIN_GET_PRIVATE (plugin);
|
||||
|
||||
if (priv->pid) {
|
||||
kill (priv->pid, SIGTERM);
|
||||
if (kill (priv->pid, SIGTERM) == 0)
|
||||
g_timeout_add (2000, ensure_killed, GINT_TO_POINTER (priv->pid));
|
||||
else
|
||||
kill (priv->pid, SIGKILL);
|
||||
|
||||
nm_info ("Terminated openvpn daemon with PID %d.", priv->pid);
|
||||
priv->pid = 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,9 @@
|
|||
2008-05-22 Tambet Ingo <tambet@gmail.com>
|
||||
|
||||
* src/nm-vpnc-service.c (real_disconnect): If sending SIGTERM succeeds,
|
||||
add a timeout to make sure it gets killed. If it fails, send SIGKILL
|
||||
immediately.
|
||||
|
||||
2008-05-01 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* src/nm-vpnc-service.c
|
||||
|
|
|
|||
|
|
@ -351,6 +351,17 @@ real_need_secrets (NMVPNPlugin *plugin,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
ensure_killed (gpointer data)
|
||||
{
|
||||
int pid = GPOINTER_TO_INT (data);
|
||||
|
||||
if (kill (pid, 0) == 0)
|
||||
kill (pid, SIGKILL);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
real_disconnect (NMVPNPlugin *plugin,
|
||||
GError **err)
|
||||
|
|
@ -358,7 +369,11 @@ real_disconnect (NMVPNPlugin *plugin,
|
|||
NMVPNCPluginPrivate *priv = NM_VPNC_PLUGIN_GET_PRIVATE (plugin);
|
||||
|
||||
if (priv->pid) {
|
||||
kill (priv->pid, SIGTERM);
|
||||
if (kill (priv->pid, SIGTERM) == 0)
|
||||
g_timeout_add (2000, ensure_killed, GINT_TO_POINTER (priv->pid));
|
||||
else
|
||||
kill (priv->pid, SIGKILL);
|
||||
|
||||
nm_info ("Terminated vpnc daemon with PID %d.", priv->pid);
|
||||
priv->pid = 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue