[gnome-keyring] daemon: Use setsid() to become a process leader when daemonizing
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-keyring] daemon: Use setsid() to become a process leader when daemonizing
- Date: Wed, 18 Jul 2012 06:02:01 +0000 (UTC)
commit 26a694b1a18a92580d211ec2d18803af0ad05d99
Author: Yclept Nemo <orbisvicis gmail com>
Date: Wed Jul 18 07:58:11 2012 +0200
daemon: Use setsid() to become a process leader when daemonizing
* Fixes corner cases where people try to use gnome-keyring-daemon
from the console.
https://bugzilla.gnome.org/show_bug.cgi?id=679892
daemon/gkd-main.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/daemon/gkd-main.c b/daemon/gkd-main.c
index f081fb8..da71da7 100644
--- a/daemon/gkd-main.c
+++ b/daemon/gkd-main.c
@@ -679,6 +679,13 @@ fork_and_print_environment (void)
if (run_daemonized) {
+ /*
+ * Become session leader of a new session, process group leader of a new
+ * process group, and detach from the controlling TTY, so that SIGHUP is
+ * not sent to this process when the previous session leader dies
+ */
+ setsid ();
+
/* Double fork if need to daemonize properly */
pid = fork ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]