diff options
author | Poh Zi How <poh.zihow@gmail.com> | 2018-10-26 07:55:13 +0800 |
---|---|---|
committer | Costa Tsaousis <costa@tsaousis.gr> | 2018-10-26 02:55:13 +0300 |
commit | 6cf0d0c0169be2588ad2e199d911d7b10df58cb2 (patch) | |
tree | 9b7dde182a1090dc616f9e7006769fa51de9b0af | |
parent | cdf57a00e1f1d8600bc0b90bf8f446ac475aef35 (diff) |
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
-rw-r--r-- | CONTRIBUTORS.md | 1 | ||||
-rw-r--r-- | daemon/main.c | 4 |
2 files changed, 5 insertions, 0 deletions
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': |