Commit Graph

13 Commits

Author SHA1 Message Date
Joris Vink 0de5d5e4c7 Use a more structured log format. 2022-09-05 10:59:06 +02:00
Daniel Fahlgren 5e21de3a4c Add printf format attributes and fix fallout 2022-08-17 13:16:18 +02:00
Joris Vink 833ca646e7 i forgot, it's 2022. 2022-01-31 22:02:06 +01:00
Joris Vink a2d48feeb7 Lets make sure milliseconds are formatted nicely. 2021-09-14 09:36:33 +02:00
Joris Vink 41511c1683 Log timestamps in UTC for, add milliseconds.
This is when using the normal foreground logs or a specified logfile.
2021-09-14 09:30:17 +02:00
Joris Vink b6ec4081d5 Oops, remove debug. 2021-09-13 22:55:09 +02:00
Joris Vink 824d6421d5 Use correct format for strftime(). 2021-09-13 22:54:05 +02:00
Joris Vink 450aabbea1 Add timestamp prefix to log when not using syslog. 2021-09-13 15:07:43 +02:00
Joris Vink 77848e0708 Always use logfile when set, even if !foreground. 2021-09-12 15:19:37 +02:00
Joris Vink b77d727f72 Add a logfile configuration option.
This will log all output from Kore processes to the specified file.
2021-09-10 13:34:57 +02:00
Joris Vink 3b20cda11c Rework worker startup/privsep config.
Starting with the privsep config, this commit changes the following:

- Removes the root, runas, keymgr_root, keymgr_runas, acme_root and
  acme_runas configuration options.

  Instead these are now configured via a privsep configuration context:

  privsep worker {
      root /tmp
      runas nobody
  }

  This is also configurable via Python using the new kore.privsep() method:

      kore.privsep("worker", root="/tmp", runas="nobody", skip=["chroot"])

Tied into this we also better handle worker startup:

- Per worker process, wait until it signalled it is ready.
- If a worker fails at startup, display its last log lines more clearly.
- Don't start acme process if no domain requires acme.
- Remove each process its individual startup log message in favour
  of a generalized one that displays its PID, root and user.
- At startup, log the kore version and built-ins in a nicer way.
- The worker processes now check things they need to start running
  before signaling they are ready (such as access to CA certs for
  TLS client authentication).
2021-09-07 21:59:22 +02:00
Joris Vink 00ef837d62 call explicit fflush() on stdout 2021-09-06 14:16:09 +02:00
Joris Vink 7f56c7dbf2 Change how worker processes do logging.
Before each worker process would either directly print to stdout if
Kore was running in foreground mode, or syslog otherwise.

With this commit the workers will submit their log messages to the
parent process who will either put it onto stdout or syslog.

This change in completely under the hood and users shouldn't care about it.
2021-09-06 13:28:38 +02:00