chiark / gitweb /
logging: site: Log state on PHASE_RUN entry instead of initially
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 16 Feb 2020 15:06:34 +0000 (15:06 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 16 Feb 2020 15:17:33 +0000 (15:17 +0000)
commit4d9d6e20e19c1aaa0d138e70897d136b36d673c0
tree2b48ff61a9173b307242d277b0f1daa35d384cbd
parent1c56b25a6e2054c0f0628e2f343f5a0df2a7772c
logging: site: Log state on PHASE_RUN entry instead of initially

site_startup calls enter_state_run which would print a message, but
logging is not set up that early.  The result is a message printed to
stderr before daemonisation.

We can distinguish this situation from other calls to enter_state_run
because the old state is SITE_STOP, which only occurs between config
reading (closure invocation) and site_startup being called.
So we can suppress this message.

But it did serve a purpose: it would only be printed if the site was
listed in `sites'; otherwise site_startup wouldn't be called and the
`entering state RUN' message would be absent.

So instead we provide a more explicit way to tell: on entering
PHASE_RUN, site_startup has either been called, or not.  And logging
is set up.  state is then STOP or RUN.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
site.c