diff options
author | Thomas Haller <thaller@redhat.com> | 2018-05-18 14:37:14 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-05-25 12:35:49 +0200 |
commit | eaf36db68bd4bdc1b626d672079dd241b4eea53e (patch) | |
tree | 161a4808ff362f9f9943a6043a1b8e543ed039f4 /src/ppp/nm-ppp-manager.c | |
parent | 43f67b42101d060c9e6b97486672a36f34bcec99 (diff) | |
download | NetworkManager-eaf36db68bd4bdc1b626d672079dd241b4eea53e.tar.gz |
core: add and use NM_SHUTDOWN_TIMEOUT_MS as duration that we plan for shutdown
nm_ppp_manager_stop() wants to ensure that the pppd process is really
gone. For that it uses nm_utils_kill_child_async() to first send
SIGTERM, and sending SIGKILL after a timeout.
Later, we want to fix shutdown of NetworkManager to iterate the mainloop
during shutdown, so that such operations are still handled. However, we
can only delay shutdown for a certain time. After a timeout (NM_SHUTDOWN_TIMEOUT_MS
plus NM_SHUTDOWN_TIMEOUT_MS_GRACE) we really have to give up and
terminate.
That means, the right amount of time between sending SIGTERM and SIGKILL
is exactly NM_SHUTDOWN_TIMEOUT_MS. Hopefully that is of course
sufficient in the first place. If not, send SIGKILL afterwards, and give
a bit more time (NM_SHUTDOWN_TIMEOUT_MS_GRACE) to reap the child.
And if all this time is still not enough, something is really odd and we
abort waiting, with a warning in the logfile.
Since we don't properly handle shutdown yet, the description above is
not really true. But with this patch, we fix it from point of view of
NMPPPManager.
Diffstat (limited to 'src/ppp/nm-ppp-manager.c')
-rw-r--r-- | src/ppp/nm-ppp-manager.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ppp/nm-ppp-manager.c b/src/ppp/nm-ppp-manager.c index e7de5d4a2e..fc658bec93 100644 --- a/src/ppp/nm-ppp-manager.c +++ b/src/ppp/nm-ppp-manager.c @@ -1253,7 +1253,8 @@ _ppp_manager_stop (NMPPPManager *self, handle->shutdown_waitobj = g_object_new (G_TYPE_OBJECT, NULL); nm_shutdown_wait_obj_register (handle->shutdown_waitobj, "ppp-manager-wait-kill-pppd"); nm_utils_kill_child_async (nm_steal_int (&priv->pid), - SIGTERM, LOGD_PPP, "pppd", 2000, + SIGTERM, LOGD_PPP, "pppd", + NM_SHUTDOWN_TIMEOUT_MS, _stop_child_cb, handle); return handle; |