From 6cf0d0c0169be2588ad2e199d911d7b10df58cb2 Mon Sep 17 00:00:00 2001 From: Poh Zi How Date: Fri, 26 Oct 2018 07:55:13 +0800 Subject: add option to run netdata in the background (#4364) * run netdata in foreground * add contributors * readd -D option * revert some changes * add explicit value for default case --- CONTRIBUTORS.md | 1 + daemon/main.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 7f6edcb5ca..178a405700 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -118,4 +118,5 @@ username|name|email (optional) @jonfairbanks|Jon Fairbanks @pjz|Paul Jimenez|pj@place.org @jgrossiord|Julien Grossiord|julien@grossiord.net +@pohzipohzi|Poh Zi How @vladmovchan|Vladyslav Movchan|vladislav.movchan@gmail.com diff --git a/daemon/main.c b/daemon/main.c index a52104db18..b2c4c80bf5 100644 --- a/daemon/main.c +++ b/daemon/main.c @@ -228,6 +228,7 @@ struct option_def option_definitions[] = { // opt description arg name default value { 'c', "Configuration file to load.", "filename", CONFIG_DIR "/" CONFIG_FILENAME}, { 'D', "Do not fork. Run in the foreground.", NULL, "run in the background"}, + { 'd', "Fork. Run in the background.", NULL, "run in the background"}, { 'h', "Display this help message.", NULL, NULL}, { 'P', "File to save a pid while running.", "filename", "do not save pid to a file"}, { 'i', "The IP address to listen to.", "IP", "all IP addresses IPv4 and IPv6"}, @@ -729,6 +730,9 @@ int main(int argc, char **argv) { case 'D': dont_fork = 1; break; + case 'd': + dont_fork = 0; + break; case 'h': return help(0); case 'i': -- cgit v1.2.3