summaryrefslogtreecommitdiff
path: root/src/core/nm-core-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/nm-core-utils.c')
-rw-r--r--src/core/nm-core-utils.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/core/nm-core-utils.c b/src/core/nm-core-utils.c
index cb62f61c34..06ebc52e0a 100644
--- a/src/core/nm-core-utils.c
+++ b/src/core/nm-core-utils.c
@@ -569,12 +569,17 @@ _kill_child_async(pid_t pid,
* @pid: the process id of the process to kill
* @log_domain: the logging domain used for logging (LOGD_NONE to suppress logging)
* @log_name: for logging, the name of the processes to kill
- * @wait_before_kill_msec: Waittime in milliseconds before sending %SIGKILL signal. Set this value
* to zero, not to send %SIGKILL. If @sig is already %SIGKILL, this parameter is ignored.
* @callback: (allow-none): callback after the child terminated. This function will always
* be invoked asynchronously.
* @user_data: passed on to callback
*
+ * Sends a SIGTERM to a process, then waits 5 seconds and unless the process
+ * has terminated it forces exit with SIGKILL.
+ *
+ * The value of 5 seconds is chosen to give even the sluggiest programs (pppd)
+ * a fair chance to clean up. Change with caution!
+ *
* Uses g_child_watch_add(), so note the glib comment: if you obtain pid from g_spawn_async() or
* g_spawn_async_with_pipes() you will need to pass %G_SPAWN_DO_NOT_REAP_CHILD as flag to the spawn
* function for the child watching to work.
@@ -585,11 +590,10 @@ void
nm_utils_term_child_async(pid_t pid,
NMLogDomain log_domain,
const char *log_name,
- guint32 wait_before_kill_msec,
NMUtilsKillChildAsyncCb callback,
void *user_data)
{
- _kill_child_async(pid, SIGTERM, log_domain, log_name, wait_before_kill_msec, callback, user_data);
+ _kill_child_async(pid, SIGTERM, log_domain, log_name, 5000, callback, user_data);
}
static gulong