Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5731274ybi; Tue, 28 May 2019 18:53:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqyCCJ8ME1VpV8/lMM1/R7JA/gW73yygkRXHUN/UuTijYkuvOWHf00fsZ2h8SuX+OuJmYNaK X-Received: by 2002:a17:902:ca4:: with SMTP id 33mr100850335plt.107.1559094808918; Tue, 28 May 2019 18:53:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559094808; cv=none; d=google.com; s=arc-20160816; b=LxSpP7lot+D8GTkF8tYD1bTWCp+RFBCqtrdQvfXcmqHsQQb+EL/S2jyK0tMTip+DVH VoR/IdAGMZqPBa+B32L+0cgt4kHsz9to3TQZFLOYNQWGEspdft5b1r3wU3+QyFfdSnrw bbF4t6sfhmKYIyBNEwDDFkFiMwRVeqXypFBTujNemE4hTJICr8MPVkilSNXHxNHHkqtY qD6k4KOF66OD7Da/BbNgso5wpc6ifgqczlBKev1r0teE81SI3QWmO59OQqzB5s61dbuR nP0n7tSQ5eP2L1HrlgsWCA4lRzudmaU7Zd9utmk5E0cLUedUw7mzWxJyH6lX+BqDCjSR 1vsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=pNCytPX/EwjGp59L2+uh4vOv5T4M/0rLygOE4g0A9Gk=; b=Zm1mMeFUjjbJXnIt5NcAlVocMgQizjJIVplJ8UNegP/Y05nH1C4G0hGrm3GppC5kV0 57Ti4GdwYnsLt6zVBwUaRdi27E49MJP8eDD1tfc7ZWE41SjnBMfBr0cH4s6vj8D7EYIf SdmJ0UC1imHegedtYAfkROVmz36FcBeEynU2dmwC0/iSMLop6P2Eeoj7KhZ3AwnZ5mlY arC4nRNIK0Tf6S8XnVfwQbGVBP+47bsFVup6snpFI8/xLYqckjU2VC6TdPj+hoov/16n mYhbIIx5OGRuIPPayla0o1Oeip8sjbJKlSF7nlaacBYn9YGjapy2e4qDDXM271VFQaop bKLA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p66si27050180pfb.34.2019.05.28.18.52.57; Tue, 28 May 2019 18:53:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725872AbfE2Bwy (ORCPT + 99 others); Tue, 28 May 2019 21:52:54 -0400 Received: from mga04.intel.com ([192.55.52.120]:44549 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725856AbfE2Bwy (ORCPT ); Tue, 28 May 2019 21:52:54 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 May 2019 18:52:54 -0700 X-ExtLoop1: 1 Received: from ingas-nuc1.sea.intel.com ([10.255.231.189]) by orsmga007.jf.intel.com with ESMTP; 28 May 2019 18:52:54 -0700 From: Inga Stotland To: linux-bluetooth@vger.kernel.org Cc: brian.gix@intel.com, johan.hedberg@gmail.com, luiz.dentz@gmail.com, Inga Stotland Subject: [PATCH BlueZ 2/2] mesh: Do not daemonize, run in foreground or as service Date: Tue, 28 May 2019 18:52:51 -0700 Message-Id: <20190529015251.15805-3-inga.stotland@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190529015251.15805-1-inga.stotland@intel.com> References: <20190529015251.15805-1-inga.stotland@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This removes call to daemon(). "--node-detach" option is retained to set umask(). Also, adds description for dbus-debug option. --- mesh/main.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/mesh/main.c b/mesh/main.c index a621300e6..1c7123cc1 100644 --- a/mesh/main.c +++ b/mesh/main.c @@ -2,7 +2,7 @@ * * BlueZ - Bluetooth protocol stack for Linux * - * Copyright (C) 2017-2018 Intel Corporation. All rights reserved. + * Copyright (C) 2017-2019 Intel Corporation. All rights reserved. * * * This library is free software; you can redistribute it and/or @@ -41,6 +41,7 @@ static const struct option main_options[] = { { "config", optional_argument, NULL, 'c' }, { "nodetach", no_argument, NULL, 'n' }, { "debug", no_argument, NULL, 'd' }, + { "dbus-debug", no_argument, NULL, 'b' }, { "help", no_argument, NULL, 'h' }, { } }; @@ -55,6 +56,7 @@ static void usage(void) "\t--config Configuration directory\n" "\t--nodetach Run in foreground\n" "\t--debug Enable debug output\n" + "\t--dbus-debug Enable D-Bus debugging\n" "\t--help Show %s information\n", __func__); } @@ -170,7 +172,8 @@ int main(int argc, char *argv[]) goto done; } - umask(0077); + if (!detached) + umask(0077); dbus = l_dbus_new_default(L_DBUS_SYSTEM_BUS); if (!dbus) { @@ -190,14 +193,6 @@ int main(int argc, char *argv[]) goto done; } - if (detached) { - if (daemon(0, 0)) { - perror("Failed to start meshd daemon"); - status = EXIT_FAILURE; - goto done; - } - } - status = l_main_run_with_signal(signal_handler, NULL); done: -- 2.21.0