Upload files to "uno-stats-monitor/unomond"
This commit is contained in:
@@ -40,7 +40,7 @@
|
|||||||
int debug = 0;
|
int debug = 0;
|
||||||
int running = 0;
|
int running = 0;
|
||||||
char *conf_file_name = "unomond.conf";
|
char *conf_file_name = "unomond.conf";
|
||||||
char *pid_file_name = NULL;
|
char *pid_file_name = "/tmp/unomond.pid";
|
||||||
int pid_fd = -1;
|
int pid_fd = -1;
|
||||||
const char *app_name = "UnomonD";
|
const char *app_name = "UnomonD";
|
||||||
FILE *log_stream;
|
FILE *log_stream;
|
||||||
@@ -149,9 +149,9 @@ int read_conf_file(int reload) {
|
|||||||
|
|
||||||
config_init(&cfg);
|
config_init(&cfg);
|
||||||
if(conf_file_name == NULL) {
|
if(conf_file_name == NULL) {
|
||||||
fprintf(log_stream, "Can not open configuration file!\n");
|
fprintf(log_stream, "Can not open configuration file %s.\n",conf_file_name);
|
||||||
syslog(LOG_INFO, "Can not open configuration file %s, exiting.",conf_file_name);
|
syslog(LOG_INFO, "Can not open configuration file %s.",conf_file_name);
|
||||||
return(EXIT_FAILURE);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// read the file. if there is an error, report it and exit
|
// read the file. if there is an error, report it and exit
|
||||||
@@ -625,6 +625,7 @@ int main(int argc, char *argv[])
|
|||||||
switch (value) {
|
switch (value) {
|
||||||
case 'c':
|
case 'c':
|
||||||
conf_file_name = strdup(optarg);
|
conf_file_name = strdup(optarg);
|
||||||
|
fprintf(log_stream, "Reloading configuation from command line...\n");
|
||||||
read_conf_file(0);
|
read_conf_file(0);
|
||||||
fprintf(log_stream, "Command Line: Using 'conffile': %s\n",conf_file_name);
|
fprintf(log_stream, "Command Line: Using 'conffile': %s\n",conf_file_name);
|
||||||
break;
|
break;
|
||||||
@@ -644,13 +645,13 @@ int main(int argc, char *argv[])
|
|||||||
break;
|
break;
|
||||||
case 'd':
|
case 'd':
|
||||||
start_daemonized = 1;
|
start_daemonized = 1;
|
||||||
fprintf(log_stream, "Command Line: Daemonizing...");
|
fprintf(log_stream, "Command Line: Daemonizing...\n");
|
||||||
break;
|
break;
|
||||||
case 'D':
|
case 'D':
|
||||||
debug = 1;
|
debug = 1;
|
||||||
fprintf(log_stream, "Command Line: Using Debugging\n");
|
fprintf(log_stream, "Command Line: Using Debugging\n");
|
||||||
break;
|
break;
|
||||||
case 'h' | '?':
|
case 'h':
|
||||||
print_help();
|
print_help();
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user