showing system's health on /dev/tty1 - GNU/Linux

Users browsing this thread: 1 Guest(s)
freem
Nixers
(19-12-2020, 05:45 PM)vain Wrote: This might be a dumb question, but how do you check if a particular daemon is running in a POSIX-ly portable way?

Well... that's the problem actually.
I already started working on it, at least, started thinking about how the monitoring should be done, without adding dependencies to daemons, thus, by just observing the system's state.
For now, my answer is basically: scan the logs, and hope they don't lie. For that to work, daemons must have a single "current" file, which, in worst cases, will advertise when the daemon is actually started (aka: after all pre-checks were done) and when it dies.
Based on that, you usually need a delay information to say the daemon is *really* doing it's job (might be few seconds, might be minutes...) because many won't say "hey, I've opened my socket and am listening on it!".

How to do that, considering file rotations, is annoying. The how to know a file is writen is rather easy: using `poll` should do the job (yet to verify), but what when there's a rotation? POSIX do not expose API to watch a directory, thus I'll need use linux-specific inotify. Ideally, I would have an #ifdef to use whatever BSD mechanism there might be...


Messages In This Thread
showing system's health on /dev/tty1 - by freem - 17-12-2020, 08:45 AM
RE: showing system's health on /dev/tty1 - by freem - 19-12-2020, 06:52 PM