Michael Tokarev via Postfix-users:
> 14.12.2024 15:52, Wietse Venema via Postfix-users ?????:
> > Michael Tokarev via Postfix-users:
> >> 09.12.2024 22:25, Wietse Venema via Postfix-users wrote:
> >>> Steffen Nurpmeso via Postfix-users:
> >>>>     postfix_status() {
> >>>>     # As postfix does not use stdout but console, no
> >>>>     #        postfix__init
> >>>>     #        ${prog} status 2>&1
> >>>
> >>> I think that was fixed in Postfix 3.8.
> >>>
> >>> 20230308
> >>>
> >>>           Cleanup: the postfix(1) and postlog(1) commands now produce
> >>>           stderr output even when stderr is not connected to a terminal.
> >>>           This eliminates an inconsistency, and makes these programs
> >>>           easier to use in some automated procedures. The canonical
> >>>           example is to capture output from "postmulti -p status" to
> >>>           figure out which instances are or are not running. Files:
> >>>           postfix/postfix.c, postlog/postlog.c.
> >> The postlog manpage states:
> >>          By default, logging is sent to syslogd(8) or postlogd(8); when
> >>          the standard error stream is connected to a terminal, logging
> >>          is sent  there  as well.
> > 
> > That text needs to be updated, because the stderr behavior has changed.
> 
> Both postfix and postconf do call isatty() and perform additional init
> if it is, though.
> 
> 
> >> Dec 14 09:27:25 gandalf postfix[165466]: postfix/postlog: starting the 
> >> Postfix mail system
> >> Dec 14 09:27:25 gandalf postfix/postfix-script[165466]: starting the 
> >> Postfix mail system
> >>
> >> One is sent by postlog to the syslog, and another is captured from
> >> the stderr/out.  It's an interesting effect.
> > 
> > Captured from stdout"? Tht is not happening in postfix-script. If
> > systemd is doing that, then I am not going to fight that.
> Please don't.  We've much better things to do in our lives and time than
> fighting needlessly.
> 
> Today systemd plays major role in linux, and linux plays major role in the
> IT world.  And while some its ideas are questionable or may look weird, some
> are interesting.  And logging is one of them: it offers a trivial logging
> capability to all services it starts, by writing to stdout or stderr
> (configurable, both by default).  The rest - adding timestamp, tag[pid],
> etc - is done by systemd and is the result is written to the log.  Priority
> is recognized too at the beginning of the line.

It also sucks raw eggs at doing this, to the point that I was
motivated to add a postlogd service to make Postfix logging reliable
again.

Enough venting, I'll have a nice belgian beer now.

        Wietse
_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

Reply via email to