On Fri, Jan 06, 2023 at 11:33:28AM -0500, Wietse Venema wrote:

> > Instead of sending a HUP signal like it is done to trigger a reload, one 
> > sends a different signal (e. g. USR1) to the master. The further 
> > processing of the signal is similar to the HUP case except that 
> > configuration dumps are triggered rather than configuration reloads.
> 
> How could that be useful? On a busy server, there will be be 100+
> smtpd (SMTP server) processes, 100+ cleanup processes, 100+ smtp
> (SMTP client) processes and so on. Those processes were started an
> different times and they will produce different dumps if you change
> Postfix configuration without "postfix reload".

+1.  It makes little sense to ask a distributed (over multiple
dynamically spawned processes) system about its "current" state.

The age in seconds of master and its descendants can be obtained via,
for example:

    $ ps -c -o etimes= -o pid= -o command= -p $(pgrep -g $(ps -o pgid= $(pgrep 
-x master))) | sort -nr
    2466115 87674 master
     384351 70993 qmgr
     384315 71008 tlsmgr
       2402 39744 pickup
        368 39967 anvil
        368 39965 smtpd
         52 40089 proxymap
         52 40088 smtpd
         14 40098 smtpd
         12 40099 trivial-rewrite

Even fancier, splice in the age the main.cf and master.cf files:

$ (
    ps -c -o etimes= -o pid= -o command= -p $(pgrep -g $(ps -o pgid= $(pgrep -x 
master)))
    perl -le '
        use File::stat;
        for (@ARGV) {printf "%d - %s\n", time - stat($_)->mtime, $_}
        ' /usr/local/etc/postfix/ma*.cf
  ) | awk '{printf "%10s %10s %s\n", $1, $2, $3}' | sort -nr
  28755246          - /usr/local/etc/postfix/master.cf
   2467086      87674 master
    385324          - /usr/local/etc/postfix/main.cf
    385322      70993 qmgr
    385286      71008 tlsmgr
      3373      39744 pickup
         1      40259 anvil
         1      40258 proxymap
         1      40257 smtpd
         0      40260 trivial-rewrite

The master(8) process is younger than master.cf and the rest are younger
than main.cf, so all is well, assuming that no critical changes
affecting master(8) were made in main.cf (inet_interfaces, ...).

-- 
    Viktor.

Reply via email to