@cryptotaxi247 / netdata-1 / commits / 6cf0d0c01

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

Poh Zi How committed Oct 26, 2018 at 07:55 UTC 6cf0d0c0169be2588ad2e199d911d7b10df58cb2
2 files changed +5
CONTRIBUTORS.md
+1
@@ -118,4 +118,5 @@ username|name|email (optional)
118 @jonfairbanks|Jon Fairbanks
119 @pjz|Paul Jimenez|pj@place.org
120 @jgrossiord|Julien Grossiord|julien@grossiord.net
121 +@pohzipohzi|Poh Zi How
122 @vladmovchan|Vladyslav Movchan|vladislav.movchan@gmail.com
daemon/main.c
+4
@@ -228,6 +228,7 @@ struct option_def option_definitions[] = {
228 // opt description arg name default value
229 { 'c', "Configuration file to load.", "filename", CONFIG_DIR "/" CONFIG_FILENAME},
230 { 'D', "Do not fork. Run in the foreground.", NULL, "run in the background"},
231 + { 'd', "Fork. Run in the background.", NULL, "run in the background"},
232 { 'h', "Display this help message.", NULL, NULL},
233 { 'P', "File to save a pid while running.", "filename", "do not save pid to a file"},
234 { 'i', "The IP address to listen to.", "IP", "all IP addresses IPv4 and IPv6"},
@@ -729,6 +730,9 @@ int main(int argc, char **argv) {
730 case 'D':
731 dont_fork = 1;
732 break;
733 + case 'd':
734 + dont_fork = 0;
735 + break;
736 case 'h':
737 return help(0);
738 case 'i':