From: Brian Gix <brian.gix@intel.com>
To: linux-bluetooth@vger.kernel.org
Cc: inga.stotland@intel.com, brian.gix@intel.com,
ludwig.nussel@suse.de, marcel@holtmann.org,
johan.hedberg@gmail.com, luiz.dentz@gmail.com
Subject: [PATCH BlueZ v4 3/3] mesh: Do not daemonize, run in foreground or as service
Date: Tue, 4 Jun 2019 13:28:52 -0700 [thread overview]
Message-ID: <20190604202852.12656-4-brian.gix@intel.com> (raw)
In-Reply-To: <20190604202852.12656-1-brian.gix@intel.com>
From: Inga Stotland <inga.stotland@intel.com>
This removes call to daemon(). "--nodetach" option is retained
to set umask().
Also, adds description for dbus-debug option.
---
mesh/main.c | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/mesh/main.c b/mesh/main.c
index a621300e6..3cecd8fbf 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' },
{ }
};
@@ -49,12 +50,13 @@ static void usage(void)
{
l_info("");
l_info("Usage:\n"
- "\tmeshd [options]\n");
+ "\tbluetooth-meshd [options]\n");
l_info("Options:\n"
"\t--index <hcinum> Use specified controller\n"
"\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.14.5
next prev parent reply other threads:[~2019-06-04 20:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-04 20:28 [PATCH BlueZ v4 0/3] mesh - Service and Installation Brian Gix
2019-06-04 20:28 ` [PATCH BlueZ v4 1/3] install: Fix installations to pkglibexecdir Brian Gix
2019-06-04 20:28 ` [PATCH BlueZ v4 2/3] build: Add support for systemd bluetooth-mesh service Brian Gix
2019-06-04 20:28 ` Brian Gix [this message]
2019-06-06 19:03 ` [PATCH BlueZ v4 0/3] mesh - Service and Installation Gix, Brian
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190604202852.12656-4-brian.gix@intel.com \
--to=brian.gix@intel.com \
--cc=inga.stotland@intel.com \
--cc=johan.hedberg@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=ludwig.nussel@suse.de \
--cc=luiz.dentz@gmail.com \
--cc=marcel@holtmann.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).