Bug 2237794 - postfix logs egrep deprecation warning on startup
Summary: postfix logs egrep deprecation warning on startup
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: postfix
Version: 38
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Jaroslav Škarvada
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-09-06 23:39 UTC by Georg Sauthoff
Modified: 2024-02-01 15:03 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Georg Sauthoff 2023-09-06 23:39:48 UTC
During service start the postfix logs contain an irritating warning message about egrep considered being obsolescent:

egrep: warning: egrep is obsolescent; using grep -E

Reproducible: Always

Steps to Reproduce:
1. systemctl restart postfix
2. journalctl -e
3.
Actual Results:  
Sep 06 23:06:58 systemd[1]: Starting postfix.service - Postfix Mail Transport Agent...
Sep 06 23:06:59 postfix[21223]: egrep: warning: egrep is obsolescent; using grep -E
Sep 06 23:06:59 postfix/postfix-script[21230]: starting the Postfix mail system
Sep 06 23:06:59 postfix/master[21232]: daemon started -- version 3.7.4, configuration /etc/postfix
Sep 06 23:06:59 systemd[1]: Started postfix.service - Postfix Mail Transport Agent.

NB: the 2nd line is the issue here

Expected Results:  
Sep 06 23:06:58 systemd[1]: Starting postfix.service - Postfix Mail Transport Agent...
Sep 06 23:06:59 postfix/postfix-script[21230]: starting the Postfix mail system
Sep 06 23:06:59 postfix/master[21232]: daemon started -- version 3.7.4, configuration /etc/postfix
Sep 06 23:06:59 systemd[1]: Started postfix.service - Postfix Mail Transport Agent.

NB: i.e. the spurious egrep warning is eliminated

Besides grepping for egrep in the postfix package files, another way to identify the source of any egrep usage is to use execsnoop.

On my system it yields:

11.408  0     egrep            21223   21221     0 /bin/egrep /(saved|incoming|active|defer|deferred|bounce|hold|trace|corrupt|public|private|flush)$ 

which comes from /usr/libexec/postfix/postfix-script

Of course there are basically 2 ways how to fix this:

1) Fix it in postfix, i.e. migrate all postfix scripts from egrep to grep -E
2) Fix it in egrep, i.e. disable that questionable warning and commit to continue supporting egrep, independently of the GNU grep upstream

Arguably, that egrep warning and the GNU grep's egrep deprecation warning is rather pointless and a quite superfluous exercise.

See also for example this well-written article that looks at it from that angle:
https://utcc.utoronto.ca/~cks/space/blog/linux/GNUGrepVersusEcology

That article also references:


Bug 2188430 - grep-3.8 is incompatible with previous versions of grep for fgrep and egrep
https://bugzilla.redhat.com/show_bug.cgi?id=2188430

Comment 1 Georg Sauthoff 2023-09-06 23:43:48 UTC
PS: I'm seeing this with postfix-3.7.4-3.fc38.x86_64 and grep-3.8-3.fc38.x86_64.

Comment 2 Jaroslav Škarvada 2023-09-25 09:53:53 UTC
It's fixed upstream in postfix-3.8 and the problem shouldn't occur in Fedora 39+.

Taking into account it's only "cosmetic" and temporal I am not sure whether it's worth the backport.


Note You need to log in before you can comment on or make changes to this bug.