Changeset 06f58e662d9dcb103af43ff53f3bd7e72248cea4

Show
Ignore:
Timestamp:
02/26/08 23:16:31 (6 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1204067791 +0000
git-parent:

[7075a66d0bf9d872f936eee678a49cfbc5cd46c5]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1204067791 +0000
Message:

prep for jlog transit over SSL

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/Makefile.in

    r308a8d6 r06f58e6  
    2828        noit_console.o noit_console_state.o noit_console_telnet.o \ 
    2929        noit_check.o noit_check_log.o noit_check_tools.o \ 
    30         noit_module.o noit_conf.o noit_conf_checks.o noit_tokenizer.o 
     30        noit_module.o noit_conf.o noit_conf_checks.o noit_tokenizer.o \ 
     31        noit_jlog_listener.o 
    3132 
    3233STRATCON_OBJS=stratcond.o noit_listener.o \ 
  • src/noit.conf

    rf8c4ac7 r06f58e6  
    1212      <log name="debug" disabled="true"/> 
    1313    </console_output> 
    14     <!--<log name="feed" type="jlog" path="/var/log/noitd.feed" />--
    15     <log name="feed"><outlet name="stderr"/></log
     14    <log name="feed" type="jlog" path="/var/log/noitd.feed" /
     15    <!--<log name="feed"><outlet name="stderr"/></log>--
    1616    <feeds> 
    1717      <outlet name="feed"/> 
     
    4949      </listener> 
    5050    </consoles> 
     51    <listener type="log_transit" address="*" port="34332"> 
     52      <config><log>feed</log></config> 
     53    </listener> 
    5154  </listeners> 
    5255  <checks max_initial_stutter="5"> 
  • src/noit_listener.c

    r2962688 r06f58e6  
    266266 
    267267void 
    268 noit_listener_reconfig() { 
     268noit_listener_reconfig(const char *toplevel) { 
    269269  int i, cnt = 0; 
    270270  noit_conf_section_t *listener_configs; 
    271  
    272   listener_configs = noit_conf_get_sections(NULL, "/noit/listeners//listener", 
    273                                             &cnt); 
    274   noitL(noit_stderr, "Found %d /noit/listeners/listener stanzas\n", cnt); 
     271  char path[256]; 
     272 
     273  snprintf(path, sizeof(path), "/%s/listeners//listener", 
     274           toplevel ? toplevel : "*"); 
     275  listener_configs = noit_conf_get_sections(NULL, path, &cnt); 
     276  noitL(noit_stderr, "Found %d %s stanzas\n", cnt, path); 
    275277  for(i=0; i<cnt; i++) { 
    276278    char address[256]; 
     
    322324} 
    323325void 
    324 noit_listener_init() { 
     326noit_listener_init(const char *toplevel) { 
    325327  eventer_name_callback("noit_listener_acceptor", noit_listener_acceptor); 
    326328  eventer_name_callback("noit_listener_accept_ssl", noit_listener_accept_ssl); 
    327   noit_listener_reconfig(); 
    328 } 
    329  
     329  noit_listener_reconfig(toplevel); 
     330} 
     331 
  • src/noit_listener.h

    r2962688 r06f58e6  
    2626} * listener_closure_t; 
    2727 
    28 API_EXPORT(void) noit_listener_init(); 
     28API_EXPORT(void) noit_listener_init(const char *toplevel); 
    2929 
    3030API_EXPORT(int) 
  • src/noitd.c

    r5f388ee r06f58e6  
    1313#include "noit_listener.h" 
    1414#include "noit_console.h" 
     15#include "noit_jlog_listener.h" 
    1516#include "noit_module.h" 
    1617#include "noit_conf.h" 
    1718#include "noit_conf_checks.h" 
    1819 
    19 static char *config_file = ETC_DIR "/noit.conf"; 
     20#define APPNAME "noit" 
     21 
     22static char *config_file = ETC_DIR "/" APPNAME ".conf"; 
    2023static int debug = 0; 
    2124 
     
    4043  int rv = 0; 
    4144  noit_hash_table *table; 
    42   table = noit_conf_get_hash(NULL, "/noit/eventer/config"); 
     45  table = noit_conf_get_hash(NULL, "/" APPNAME "/eventer/config"); 
    4346  if(table) { 
    4447    noit_hash_iter iter = NOIT_HASH_ITER_ZERO; 
     
    6770 
    6871  /* Next load the configs */ 
    69   noit_conf_init("noit"); 
    70   noit_conf_checks_init("noit"); 
     72  noit_conf_init(APPNAME); 
     73  noit_conf_checks_init(APPNAME); 
    7174  if(noit_conf_load(config_file) == -1) { 
    7275    fprintf(stderr, "Cannot load config: '%s'\n", config_file); 
     
    7477 
    7578  /* Reinitialize the logging system now that we have a config */ 
    76   noit_conf_log_init("noit"); 
     79  noit_conf_log_init(APPNAME); 
    7780  if(debug) 
    7881    noit_debug->enabled = 1; 
    7982 
    8083  /* Lastly, run through all other system inits */ 
    81   if(!noit_conf_get_stringbuf(NULL, "/noit/eventer/@implementation", 
     84  if(!noit_conf_get_stringbuf(NULL, "/" APPNAME "/eventer/@implementation", 
    8285                              conf_str, sizeof(conf_str))) { 
    8386    noitL(noit_stderr, "Cannot find '%s' in configuration\n", 
    84           "/noit/eventer/@implementation"); 
     87          "/" APPNAME "/eventer/@implementation"); 
    8588    exit(-1); 
    8689  } 
     
    97100    exit(-1); 
    98101  } 
     102  /* Initialize all of our listeners */ 
    99103  noit_console_init(); 
     104  noit_jlog_listener_init(); 
     105 
    100106  noit_module_init(); 
    101107  noit_poller_init(); 
    102   noit_listener_init(); 
     108  noit_listener_init(APPNAME); 
    103109 
    104110  eventer_loop(); 
  • src/stratcond.c

    r308a8d6 r06f58e6  
    1616#include "noit_conf.h" 
    1717 
    18 static char *config_file = ETC_DIR "/stratcon.conf"; 
     18#define APPNAME "stratcon" 
     19static char *config_file = ETC_DIR "/" APPNAME ".conf"; 
    1920static int debug = 0; 
    2021 
     
    3940  int rv = 0; 
    4041  noit_hash_table *table; 
    41   table = noit_conf_get_hash(NULL, "/stratcon/eventer/config"); 
     42  table = noit_conf_get_hash(NULL, "/" APPNAME "/eventer/config"); 
    4243  if(table) { 
    4344    noit_hash_iter iter = NOIT_HASH_ITER_ZERO; 
     
    6667 
    6768  /* Next load the configs */ 
    68   noit_conf_init("stratcon"); 
     69  noit_conf_init(APPNAME); 
    6970  if(noit_conf_load(config_file) == -1) { 
    7071    fprintf(stderr, "Cannot load config: '%s'\n", config_file); 
     
    7273 
    7374  /* Reinitialize the logging system now that we have a config */ 
    74   noit_conf_log_init("stratcon"); 
     75  noit_conf_log_init(APPNAME); 
    7576  if(debug) 
    7677    noit_debug->enabled = 1; 
    7778 
    7879  /* Lastly, run through all other system inits */ 
    79   if(!noit_conf_get_stringbuf(NULL, "/stratcon/eventer/@implementation", 
     80  if(!noit_conf_get_stringbuf(NULL, "/" APPNAME "/eventer/@implementation", 
    8081                              conf_str, sizeof(conf_str))) { 
    8182    noitL(noit_stderr, "Cannot find '%s' in configuration\n", 
    82           "/stratcon/eventer/@implementation"); 
     83          "/" APPNAME "/eventer/@implementation"); 
    8384    exit(-1); 
    8485  } 
     
    9697  } 
    9798  noit_console_init(); 
    98   noit_listener_init(); 
     99  noit_listener_init(APPNAME); 
    99100 
    100101  eventer_loop(); 
  • src/utils/noit_log.c

    ra136e61 r06f58e6  
    177177  ls->name = strdup(name); 
    178178  ls->path = path ? strdup(path) : NULL; 
     179  ls->type = type ? strdup(type) : NULL; 
    179180  ls->enabled = 1; 
    180181  ls->config = config; 
     
    212213  free(ls->name); 
    213214  if(ls->path) free(ls->path); 
     215  if(ls->type) free(ls->type); 
    214216  free(ls); 
    215217  return NULL; 
  • src/utils/noit_log.h

    r1648bed r06f58e6  
    2525 
    2626typedef struct _noit_log_stream { 
     27  char *type; 
    2728  char *name; 
    2829  int enabled;