You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We used to create an empty pidfile, and write the pid only after
starting the interface. Having pidfile without a pid does not make
sense, as other processes cannot use the pid to terminate the process.
For example if starting the interface is blocking for long time due to a
bug, we are left with unhelpful pid file.
To keep the main flow more clear, add a helper to create and remove the
pid file. The helpers check all errors and log better log messages using
ERRORF instead of ERRORN, including the pidfile path.
Previously if we got a short write to the pidfile, we log bogus error
since errno is set only when write return negative return value.
Rename pid_fd to pidfile_fd to avoid confusion with Linux's pidfd
https://man7.org/linux/man-pages/man2/pidfd_open.2.html.
Signed-off-by: Nir Soffer <nirsof@gmail.com>
0 commit comments