cloudflare / tableflip

Graceful process restarts in Go
BSD 3-Clause "New" or "Revised" License
2.88k stars 147 forks source link

Logs go missing after systemd-journald restart #38

Closed lmb closed 4 years ago

lmb commented 4 years ago

There is an unfortunate interaction between tableflip upgrades and restarting journald, see https://github.com/systemd/systemd/issues/13708

The work around is to log to /run/systemd/journald/socket using SOCK_DGRAM. We should document this.

jameshartig commented 4 years ago

Would the recommendation be to use the journal[1] package to log to instead of stdout?

[1] https://godoc.org/github.com/coreos/go-systemd/journal

lmb commented 4 years ago

I've not used that package myself, but it seems to do the correct thing to make this work. You can combine it with https://www.freedesktop.org/software/systemd/man/systemd.exec.html#$JOURNAL_STREAM to only log to journald when being run under systemd.