mailwatch / MailWatch

MailWatch for MailScanner is a web-based front-end to MailScanner
http://mailwatch.org/
GNU General Public License v2.0
115 stars 66 forks source link

improvements for service status display #1263

Closed dneuhaeuser closed 1 year ago

dneuhaeuser commented 1 year ago

Unfortunately I messed up my first PR, sorry for that!

So here are my further reworked improvements for the service status again. This should now be compatible with BSD and Linux.

When Mailscanner is in milter mode (MTA = msmail) the service status only counted the postfix master process (so the count was always just showing 1). For consistency I suggest to use the same logic as without milter mode and display the total postfix process count including its child procs.

On Linux systems (e.g. Ubuntu 22.04.1 LTS) by default there is a header line in the 'ps' output. Therefore postfix was reported as running when it wasn't because the process count was always too high by 1.

Also, with Mailscanner's "Milter Dispatcher = postfork" and the system idling, the status displays: "MSMilter: YES | 0 children", which is confusing. I suggest to always just display the total process count (and to not subtract 1 for a display of child count).

shawniverson commented 1 year ago

I'll take a look at this and let you know my feedback

shawniverson commented 1 year ago

This looks good, I tested it on my instance.