G'day, On 30/09/11 19:38, Zbierski Christophe wrote: > Hi, I continued to analyze the problem : > > In master.c (main() function) > > masterconf_getsection("START", &add_start, NULL); > masterconf_getsection("SERVICES", &add_service, NULL); > masterconf_getsection("EVENTS", &add_event, NULL); > > /* set signal handlers */ > sighandler_setup(); > > /* initialize services */ > for (i = 0; i < nservices; i++) { > service_create(&Services[i]); > if (verbose > 2) > syslog(LOG_DEBUG, "init: service %s socket %d pipe %d %d", > Services[i].name, Services[i].socket, > Services[i].stat[0], Services[i].stat[1]); > } > > There is 2 actions, one to read the configuration (add_service()), and > another to create services (service_create()). > nservices contains the number of services, it's updated in add_service(), but > service_create() function also updates this variable : > > if (s == &service) { > if (nservices == allocservices) { > if (allocservices > SERVICE_MAX - 5) > fatal("out of service structures, please restart", > EX_UNAVAILABLE); > Services = xrealloc(Services, > (allocservices+=5) * sizeof(struct > service)); > if (!Services) fatal("out of memory", EX_UNAVAILABLE); > } > memcpy(&Services[nservices++], s, sizeof(struct service)); > } > > I do not understand this part of code.
Christophe, did you get further in your analysis? If not, can you please create a Bugzilla ticket? I may have some time soon to poke around in the master process. -- Greg.