Changeset caa7b86e0a2913bf4f9e3254320a05dd636b2e06 for src/noitd.c
- Timestamp:
- 01/26/08 20:48:28 (5 years ago)
- git-parent:
- Files:
-
- src/noitd.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
src/noitd.c
r2c65def rcaa7b86 8 8 #include <fcntl.h> 9 9 10 #include "getopt_long.h"11 10 #include "eventer/eventer.h" 12 11 #include "utils/noit_log.h" … … 35 34 36 35 int main(int argc, char **argv) { 36 char conf_str[1024]; 37 37 parse_clargs(argc, argv); 38 38 39 /* First initialize logging, so we can log errors */ 39 40 noit_log_init(); 40 41 if(debug) … … 42 43 noit_log_stream_add_stream(noit_error, noit_stderr); 43 44 45 /* Next load the configs */ 44 46 noit_conf_init(); 45 47 if(noit_conf_load(config_file) == -1) { 46 48 fprintf(stderr, "Cannot load config: '%s'\n", config_file); 47 49 } 48 if(eventer_choose("kqueue") == -1) { 49 fprintf(stderr, "Cannot choose kqueue\n"); 50 51 /* Lastly, run through all other system inits */ 52 if(!noit_conf_get_stringbuf(NULL, "/global/eventer/implementation", 53 conf_str, sizeof(conf_str))) { 54 noit_log(noit_stderr, NULL, "Cannot find '%s' in configuration\n", 55 "/global/eventer/implementation"); 56 exit(-1); 57 } 58 if(eventer_choose(conf_str) == -1) { 59 noit_log(noit_stderr, NULL, "Cannot choose eventer %s\n", conf_str); 50 60 exit(-1); 51 61 } 52 62 if(eventer_init() == -1) { 53 fprintf(stderr, "Cannot init kqueue\n");63 noit_log(noit_stderr, NULL, "Cannot init eventer %s\n", conf_str); 54 64 exit(-1); 55 65 } 66 noit_console_init(); 56 67 57 noit_listener("127.0.0.1", 23123, SOCK_STREAM, 5, noit_console_handler, NULL); 68 noit_listener_init(); 69 58 70 eventer_loop(); 59 71 return 0;
