chiark / gitweb /
logging: Move "starting" message earlier
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 16 Feb 2020 14:47:24 +0000 (14:47 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 16 Feb 2020 15:17:00 +0000 (15:17 +0000)
We are going to add some log messages to PHASE_RUN hooks.  We want the
overall startup message to come first.  Doing this right after
PHASE_DAEMONIZE makes sense as PHASE_DAEMONIZE now sets up logging,
too.

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

index a00124f17706079f1074305ad25f830b0d57e9d5..2ebcddc1ae94491bbf5ad90edb1f12e3a84049dd 100644 (file)
--- a/secnet.c
+++ b/secnet.c
@@ -329,8 +329,6 @@ static void run(void)
     struct pollfd *fds=0;
     int allocdfds=0, shortfall=0;
 
-    Message(M_NOTICE,"%s [%d]: starting\n",version,secnet_pid);
-
     do {
        if (gettimeofday(&tv_now_global, NULL)!=0) {
            fatal_perror("main loop: gettimeofday");
@@ -517,6 +515,7 @@ int main(int argc, char **argv)
 
     enter_phase(PHASE_DAEMONIZE);
     become_daemon();
+    Message(M_NOTICE,"%s [%d]: starting\n",version,secnet_pid);
     
     enter_phase(PHASE_GETRESOURCES);
     /* Appropriate phase hooks will have been run */