From: Omar Polo Subject: Re: gotd PID issue To: Stefan Sperling Cc: gameoftrees@openbsd.org Date: Sat, 21 Jan 2023 19:30:22 +0100 On 2023/01/21 12:28:27 +0100, Stefan Sperling wrote: > There is a mismatch between gotd process IDs shown by 'gotctl info' and > gotd's debug logs, and the actual process IDs shown by pgrep, top, and > in syslog. > > The reason is that the daemon(3) function forks and we don't take into > account that this changes the PID. > > This patch makes gotd store its own PID after daemon(3), and avoids > calling daemon(3) needlessly in child processes such that the PID > the parent has stored for them will remain correct. Yes, calling deamon only once in the main process is the right thing to do here. ok op@