Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp989256ybi; Fri, 31 May 2019 11:55:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqzMZbgLaIENUx9EZKlsV62yXorqtYCJVT0WlTAZuCXqADXrEUcDSM6MZhfxxsGd/E0/PXW+ X-Received: by 2002:a17:902:ca4:: with SMTP id 33mr11433195plt.107.1559328927359; Fri, 31 May 2019 11:55:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559328927; cv=none; d=google.com; s=arc-20160816; b=uN8FA5wCI9poq0PRm4sxMMNxULxkNedioRfXR587W+8nw7haBOegkCbaoHRqijQv3x QJQk+K7hJqvL7MJmYpTHlqRxHipoU+rxXsegaT9fW8Exz+EylGPmMtdej9xgrYAUTPXS LkfMCDVQXrqWxmyju9we82sSLD0xXXmuOD8HRBvs9PwNnzeS3Q8MOFh47XQbFjKgvs3X vmD7vXtjjxWaSXevSeefbtslYN476iVJUV3XbpCWNbFMB1s+vLwh/ult10Mg1PgB/oX0 2Zu7lfgbsYxv5vTXPYDf44QIwDrV0k5KFwooj9JJC5dij7Lec2rQR/prBLMiC2RvbRno Jcmg== 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=FiJBL883pod/hO/Wl5HX1ubpbxckMIN/0uGoAToDsWfcZtRYIs62q/wdneNQsGjJsv QVQeYxHyYh5CtYIQm/Xm9YiAweYBpQQe7l2XEaha4WoumWFabKrnJiAmtgFxx2C9T3sS yowaAqY7jyukNs6rtzHxBhXltglSdy2q947fTeV/a1Bb2BfYq9FPVB4rTeF0A+1XUenk P4Cm5S9DxTvxcuqITkt65F1E+V5Wd2JCxeDq9BobYLvimHU51047r2vB+LvdMRlZXZkV LZX5inqIjZVSBpPFsFjrFZkQYkYUbBr97i0K3CAr3BbewC7Hunwkh4aywUQKyaO7Wq1e qZVQ== 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 c1si6973352plo.203.2019.05.31.11.55.09; Fri, 31 May 2019 11:55:27 -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 S1726640AbfEaSyx (ORCPT + 99 others); Fri, 31 May 2019 14:54:53 -0400 Received: from mga17.intel.com ([192.55.52.151]:38242 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727146AbfEaSyx (ORCPT ); Fri, 31 May 2019 14:54:53 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 May 2019 11:54:53 -0700 X-ExtLoop1: 1 Received: from ingas-nuc1.sea.intel.com ([10.252.132.160]) by fmsmga005.fm.intel.com with ESMTP; 31 May 2019 11:54:52 -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 v2] mesh: Do not daemonize, run in foreground or as service Date: Fri, 31 May 2019 11:54:49 -0700 Message-Id: <20190531185449.9133-3-inga.stotland@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190531185449.9133-1-inga.stotland@intel.com> References: <20190531185449.9133-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