[system-tools-backends-clone] Don't daemonize by default



commit 8858c19b2447ca6e3abb8f3e3f0e5c04a7344a54
Author: Milan Bouchet-Valat <nalimilan club fr>
Date:   Mon Sep 14 21:40:53 2009 +0200

    Don't daemonize by default
    
    D-Bus activation can return an error if we daemonize, so we should not do this be default, and let D-Bus daemonize the dispatcher. Thus, add a -D option to force this behavior if needed, and make -n a no-op. In the process, the commit removes the handling of the old STB_NO_DAEMON envvar, which has become useless. This fixes https://bugs.launchpad.net/bugs/411533. See also an explanation at https://bugzilla.gnome.org/show_bug.cgi?id=583356.

 dispatcher/main.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/dispatcher/main.c b/dispatcher/main.c
index e4318bc..1b52182 100644
--- a/dispatcher/main.c
+++ b/dispatcher/main.c
@@ -88,12 +88,15 @@ main (int argc, char *argv[])
 {
   GMainLoop *main_loop;
   gboolean debug = FALSE;
-  gboolean no_daemon = FALSE;
+  gboolean daemon = FALSE;
   GOptionContext *context;
   GOptionEntry entries[] =
     {
       { "debug",     'd', 0, G_OPTION_ARG_NONE, &debug,     "Debug mode",     NULL },
-      { "no-daemon", 'n', 0, G_OPTION_ARG_NONE, &no_daemon, "No daemon mode", NULL },
+      { "daemon",    'D', 0, G_OPTION_ARG_NONE, &daemon, "Daemon mode", NULL },
+      /* Option kept for backward compatibility */
+      { "no-daemon", 'n', G_OPTION_FLAG_HIDDEN | G_OPTION_FLAG_REVERSE,
+                             G_OPTION_ARG_NONE, &daemon, "No daemon mode (default)", NULL },
       { NULL }
     };
 
@@ -105,8 +108,7 @@ main (int argc, char *argv[])
   g_option_context_parse (context, &argc, &argv, NULL);
   g_option_context_free (context);
 
-  /* keep the envvar for backwards compat */
-  if (!no_daemon && !getenv ("STB_NO_DAEMON"))
+  if (daemon)
     daemonize ();
 
   signal (SIGTERM, signal_received);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]