static void enter_state_run(struct site *st)
{
- slog(st,LOG_STATE,"entering state RUN%s",
- current_valid(st) ? " (keyed)" : " (unkeyed)");
+ if (st->state!=SITE_STOP)
+ slog(st,LOG_STATE,"entering state RUN%s",
+ current_valid(st) ? " (keyed)" : " (unkeyed)");
st->state=SITE_RUN;
st->timeout=0;
send_msg7(st,"shutting down");
}
+static void site_phase_run_hook(void *sst, uint32_t newphase)
+{
+ struct site *st=sst;
+ slog(st,LOG_STATE,"entering phase RUN in state %s",
+ state_name(st->state));
+}
+
static void site_childpersist_clearkeys(void *sst, uint32_t newphase)
{
struct site *st=sst;
cfgfatal(loc,"site","%s is not a closure\n",dictkey); \
closure_t *cl=item->data.closure; \
if (cl->type!=CL_TYPE) \
- cfgfatal(loc,"site","%s closure wrong type\n",dictkey); \
+ cfgfatal_cl_type(loc,"site",cl,CL_TYPE,dictkey); \
st->things[i]=cl->interface; \
} \
}while(0)
enter_state_stop(st);
add_hook(PHASE_SHUTDOWN,site_phase_shutdown_hook,st);
+ add_hook(PHASE_RUN, site_phase_run_hook, st);
add_hook(PHASE_CHILDPERSIST,site_childpersist_clearkeys,st);
return new_closure(&st->cl);