NetworkManager killing dispatched scripts too quickly

Bug #1325462 reported by Michisteiner
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
network-manager (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

/usr/lib/NetworkManager/nm-dispatcher.action has an undocumented and unconfigurable "feature" of killing scripts after 3 seconds. For a number of settings this is too short. It is unclear why this killing really has to happen but for sure it would be good to give a bit more time. Find below a patch which gives a bit more lee-way.

See similar issue in fedora where it was recently "fixed": https://bugzilla.redhat.com/show_bug.cgi?id=909577.

--- network-manager-0.9.8.8/callouts/nm-dispatcher-action.c 2014-06-02 10:31:45.317526574 +0530
+++ network-manager-0.9.8.8/callouts/nm-dispatcher-action.c.orig 2014-06-02 10:38:09.000000000 +0530
@@ -246,7 +246,6 @@
  next_script (script->request);
 }

-#define SCRIPT_TIMEOUT 60
 static gboolean
 script_timeout_cb (gpointer user_data)
 {
@@ -256,7 +255,7 @@
  script->request->script_watch_id = 0;
  script->request->script_timeout_id = 0;

- g_warning ("Script '%s' took too long (>%d); killing it.", script->script, SCRIPT_TIMEOUT);
+ g_warning ("Script '%s' took too long; killing it.", script->script);

  if (kill (script->pid, 0) == 0)
   kill (script->pid, SIGKILL);
@@ -351,7 +350,7 @@

  if (g_spawn_async ("/", argv, request->envp, G_SPAWN_DO_NOT_REAP_CHILD, child_setup, request, &script->pid, &error)) {
   request->script_watch_id = g_child_watch_add (script->pid, (GChildWatchFunc) script_watch_cb, script);
- request->script_timeout_id = g_timeout_add_seconds (SCRIPT_TIMEOUT, script_timeout_cb, script);
+ request->script_timeout_id = g_timeout_add_seconds (3, script_timeout_cb, script);
  } else {
   g_warning ("Failed to execute script '%s': (%d) %s",
              script->script, error->code, error->message);

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in network-manager (Ubuntu):
status: New → Confirmed
Revision history for this message
Michisteiner (michisteiner) wrote :

Any plans to upgrade to 0.9.9 which now at least waits 20 seconds and/or at least backport that change? As admitted by NM maintainer's, 3 seconds was unreasonably short ..

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.