OSDN Git Service

core: Don't daemonize and just toggle foreground logging
authorMarcel Holtmann <marcel@holtmann.org>
Mon, 10 Dec 2012 22:16:20 +0000 (23:16 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Mon, 10 Dec 2012 22:16:20 +0000 (23:16 +0100)
src/bluetooth.service.in
src/main.c

index 7885119..8bbd703 100644 (file)
@@ -4,8 +4,7 @@ Description=Bluetooth service
 [Service]
 Type=dbus
 BusName=org.bluez
-ExecStart=@libexecdir@/bluetoothd -n
-StandardOutput=null
+ExecStart=@libexecdir@/bluetoothd
 NotifyAccess=main
 #WatchdogSec=10
 #Restart=on-failure
index 9812ab0..af590c2 100644 (file)
@@ -428,7 +428,7 @@ static GOptionEntry options[] = {
                                "Specify plugins not to load", "NAME,..." },
        { "nodetach", 'n', G_OPTION_FLAG_REVERSE,
                                G_OPTION_ARG_NONE, &option_detach,
-                               "Don't run as daemon in background" },
+                               "Run with logging in foreground" },
        { "version", 'v', 0, G_OPTION_ARG_NONE, &option_version,
                                "Show version information and exit" },
        { NULL },
@@ -465,13 +465,6 @@ int main(int argc, char *argv[])
                exit(0);
        }
 
-       if (option_detach == TRUE) {
-               if (daemon(0, 0)) {
-                       perror("Can't start daemon");
-                       exit(1);
-               }
-       }
-
        umask(0077);
 
        event_loop = g_main_loop_new(NULL, FALSE);