Bug 31327

Summary: on boot: warning egrep is obsolete using grep -e
Product: Mageia Reporter: Elmar Stellnberger <estellnb>
Component: RPM PackagesAssignee: Base system maintainers <basesystem>
Status: NEW --- QA Contact:
Severity: minor    
Priority: Normal CC: davidwhodgins
Version: Cauldron   
Target Milestone: ---   
Hardware: All   
OS: Linux   
See Also: https://bugs.mageia.org/show_bug.cgi?id=30844
https://bugs.mageia.org/show_bug.cgi?id=31334
Whiteboard:
Source RPM: initscripts-10.04-2.mga9.src.rpm CVE:
Status comment:
Attachments: grep [ef]grep $(rpm -ql shorewall) 2>/dev/null
grep -n [ef]grep $(rpm -ql shorewall) 2>/dev/null

Description Elmar Stellnberger 2022-12-26 19:09:04 CET
After uninstalling the dkms-nvidia module I got the error message "warning egrep is obsolete using grep -e" on boot directly after the message "checking for new hardware". I am not sure which systemd file is responsible for it and what script still contains the egrep command. Please hint me if you have found it.
Comment 1 Lewis Smith 2022-12-26 20:36:44 CET
Thank you for the report, not the first about this warning (from another place):
 Bug 30844 . Doubtless we shall see it again...
I do not have either the hardware check or the egrep error message in my system journal. Can you post a short section of the journal before it?

Assigning to basesystem for systemd.

Source RPM: (none) => systemd-252.4-1.mga9.src.rpm
See Also: (none) => https://bugs.mageia.org/show_bug.cgi?id=30844
Assignee: bugsquad => basesystem

Comment 2 Dave Hodgins 2022-12-26 21:48:24 CET
The checking for new hardware is from mandrake_everytime.

I'm running m8 currently.

# grep egrep /etc/init.d/*
/etc/init.d/mandrake_everytime:    NUMPROC=`egrep -c "^cpu[0-9]+" /proc/stat`
# rpm -q -f /etc/init.d/mandrake_everytime 
initscripts-9.78-27.mga8

It's still there in cauldron
https://svnweb.mageia.org/packages/cauldron/initscripts/current/SOURCES/initscripts-10.04-mageia.patch?revision=1614631&view=markup#l1961

Source RPM: systemd-252.4-1.mga9.src.rpm => initscripts-10.04-2.mga9.src.rpm
CC: (none) => davidwhodgins

Comment 3 Elmar Stellnberger 2022-12-27 09:37:29 CET
Strange, it did not end up in the syslog. I have run 'journalctl --since "2022-12-26"| grep egrep' and I got no result. Instead there are multiple matches for an obsolete fgrep concerning Shorewall. I have seen the "obsolete egrep, use grep -E" at least two times on boot.
Comment 4 Elmar Stellnberger 2022-12-27 09:42:06 CET
Checking initscripts was a good hint, Dave, since at me (Mageia not Mandrake) there was (I had tried it as I filed the bug) not match in /etc/init.d or /etc/rc.*.
# grep egrep $(rpm -ql initscripts) 2>/dev/null
/usr/libexec/mageia_everytime:    NUMPROC=`egrep -c "^cpu[0-9]+" /proc/stat`
/usr/sbin/service:		egrep -q 'restart.*\)' $subsys || continue
/usr/sbin/service:		echo $(egrep -a '^#.*chkconfig: ' $subsys|awk '{print $4}') $subsys
/usr/sbin/service:	    if egrep -q ".*disable.*yes.*" ${xinetddir}/${serv};then
/usr/sbin/service:	if egrep -q '^([^#]*)status\)' $service;then
Comment 5 Elmar Stellnberger 2022-12-27 09:48:27 CET
Created attachment 13602 [details]
grep [ef]grep $(rpm -ql shorewall) 2>/dev/null

Shall I also paste the fgrep-s for Shorewall here or open an on bug on Shorewall for it? There was no fgrep in initscripts on Mageia 9.
Comment 6 Elmar Stellnberger 2022-12-27 09:51:47 CET
Created attachment 13603 [details]
grep -n [ef]grep $(rpm -ql shorewall) 2>/dev/null

It shall be done with grep -n to get line numbers:
# grep -n egrep $(rpm -ql initscripts) 2>/dev/null
/usr/libexec/mageia_everytime:77:    NUMPROC=`egrep -c "^cpu[0-9]+" /proc/stat`
/usr/sbin/service:34:		egrep -q 'restart.*\)' $subsys || continue
/usr/sbin/service:37:		echo $(egrep -a '^#.*chkconfig: ' $subsys|awk '{print $4}') $subsys
/usr/sbin/service:58:	    if egrep -q ".*disable.*yes.*" ${xinetddir}/${serv};then
/usr/sbin/service:120:	if egrep -q '^([^#]*)status\)' $service;then

Attachment 13602 is obsolete: 0 => 1

Comment 7 Dave Hodgins 2022-12-27 16:50:08 CET
On Mageia 8 ...
$ grep -n [ef]grep $(rpm -ql initscripts) 2>/dev/null
/etc/rc.d/init.d/mandrake_everytime:77:    NUMPROC=`egrep -c "^cpu[0-9]+" /proc/stat`
/etc/sysconfig/network-scripts/ifdown-eth:121:    ps xw | egrep "${CLIENTS}" | grep ${DEVICE} | awk '{print $1;}'
/etc/sysconfig/network-scripts/ifdown-eth:164:    for ip in `ip addr show | egrep ${DEVICE}\$ | grep inet | awk '{print $2;}'`; do
/etc/sysconfig/network-scripts/ifup-wireless:136:        echo "$WIRELESS_ENC_KEY" | egrep -q '^(open|restricted) '
/usr/sbin/service:34:           egrep -q 'restart.*\)' $subsys || continue
/usr/sbin/service:37:           echo $(egrep -a '^#.*chkconfig: ' $subsys|awk '{print $4}') $subsys
/usr/sbin/service:58:       if egrep -q ".*disable.*yes.*" ${xinetddir}/${serv};then
/usr/sbin/service:120:  if egrep -q '^([^#]*)status\)' $service;then
Comment 8 Dave Hodgins 2022-12-27 16:52:04 CET
One bug per package. Optionally a tracker bug that depends on all of the
other bugs.
Elmar Stellnberger 2022-12-28 10:30:02 CET

Attachment 13603 is obsolete: 0 => 1

Comment 9 Elmar Stellnberger 2022-12-28 10:30:37 CET
bug for Shorewall is no bug 31334.
Lewis Smith 2022-12-29 09:16:35 CET

See Also: (none) => https://bugs.mageia.org/show_bug.cgi?id=31334