summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2011-12-22 12:28:07 -0500
committerRay Strode <rstrode@redhat.com>2011-12-22 12:28:07 -0500
commit4cb2b3fa34d43e72325bba210f86a0732856090a (patch)
treed6b709449b8e86ba2ff017434b3d69903f378ea4
parentc03302bfd51da2bca4e836b1af2c477e241e9c9d (diff)
downloadgdm-4cb2b3fa34d43e72325bba210f86a0732856090a.tar.gz
daemon: don't every SIGKILL children
There's no situation where it's the right thing to do. The children of the daemon are responsible for themselves. If they don't go away when asked we shouldn't second guess them, we just need to ignore them. This means we may end up with zombie children if those children have bugs, but it's better than prematurely killing them if they're slow.
-rw-r--r--common/gdm-common.c17
-rw-r--r--common/gdm-common.h4
-rw-r--r--daemon/gdm-session-worker-job.c2
3 files changed, 11 insertions, 12 deletions
diff --git a/common/gdm-common.c b/common/gdm-common.c
index 865341a2..e035dfd7 100644
--- a/common/gdm-common.c
+++ b/common/gdm-common.c
@@ -84,8 +84,8 @@ gdm_get_pwent_for_name (const char *name,
}
int
-gdm_wait_on_and_kill_pid (int pid,
- int timeout)
+gdm_wait_on_and_disown_pid (int pid,
+ int timeout)
{
int status;
int ret;
@@ -121,17 +121,16 @@ gdm_wait_on_and_kill_pid (int pid,
path = g_strdup_printf ("/proc/%ld/cmdline", (long) pid);
if (g_file_get_contents (path, &command, NULL, NULL)) {;
- g_debug ("GdmCommon: process (pid:%d, command '%s') isn't dying, now killing it.",
- (int) pid, command);
+ g_warning ("GdmCommon: process (pid:%d, command '%s') isn't dying after %d seconds, now ignoring it.",
+ (int) pid, command, timeout);
g_free (command);
} else {
- g_debug ("GdmCommon: process (pid:%d) isn't dying, now killing it.",
- (int) pid);
+ g_warning ("GdmCommon: process (pid:%d) isn't dying after %d seconds, now ignoring it.",
+ (int) pid, timeout);
}
g_free (path);
- kill (pid, SIGKILL);
- flags = 0;
+ return 0;
}
goto wait_again;
}
@@ -151,7 +150,7 @@ gdm_wait_on_and_kill_pid (int pid,
int
gdm_wait_on_pid (int pid)
{
- return gdm_wait_on_and_kill_pid (pid, 0);
+ return gdm_wait_on_and_disown_pid (pid, 0);
}
int
diff --git a/common/gdm-common.h b/common/gdm-common.h
index 41ddf1c1..899be50e 100644
--- a/common/gdm-common.h
+++ b/common/gdm-common.h
@@ -33,8 +33,8 @@ G_BEGIN_DECLS
gboolean gdm_is_version_unstable (void);
int gdm_wait_on_pid (int pid);
-int gdm_wait_on_and_kill_pid (int pid,
- int timeout);
+int gdm_wait_on_and_disown_pid (int pid,
+ int timeout);
int gdm_signal_pid (int pid,
int signal);
gboolean gdm_get_pwent_for_name (const char *name,
diff --git a/daemon/gdm-session-worker-job.c b/daemon/gdm-session-worker-job.c
index ac96cf1c..cb2901a5 100644
--- a/daemon/gdm-session-worker-job.c
+++ b/daemon/gdm-session-worker-job.c
@@ -289,7 +289,7 @@ handle_session_worker_job_death (GdmSessionWorkerJob *session_worker_job)
int exit_status;
g_debug ("GdmSessionWorkerJob: Waiting on process %d", session_worker_job->priv->pid);
- exit_status = gdm_wait_on_and_kill_pid (session_worker_job->priv->pid, 3);
+ exit_status = gdm_wait_on_and_disown_pid (session_worker_job->priv->pid, 5);
if (WIFEXITED (exit_status) && (WEXITSTATUS (exit_status) != 0)) {
g_debug ("GdmSessionWorkerJob: Wait on child process failed");