Skip to content

Commit

Permalink
add option to run netdata in the background (netdata#4364)
Browse files Browse the repository at this point in the history
* run netdata in foreground

* add contributors

* readd -D option

* revert some changes

* add explicit value for default case
  • Loading branch information
Poh Zi How authored and ktsaou committed Oct 25, 2018
1 parent cdf57a0 commit 6cf0d0c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,5 @@ username|name|email (optional)
@jonfairbanks|Jon Fairbanks
@pjz|Paul Jimenez|[email protected]
@jgrossiord|Julien Grossiord|[email protected]
@pohzipohzi|Poh Zi How
@vladmovchan|Vladyslav Movchan|[email protected]
4 changes: 4 additions & 0 deletions daemon/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down Expand Up @@ -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':
Expand Down

0 comments on commit 6cf0d0c

Please sign in to comment.