Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some resource agents still use egrep/fgrep. #2003

Closed
SatomiOSAWA opened this issue Dec 24, 2024 · 2 comments · Fixed by #2011
Closed

Some resource agents still use egrep/fgrep. #2003

SatomiOSAWA opened this issue Dec 24, 2024 · 2 comments · Fixed by #2011
Assignees

Comments

@SatomiOSAWA
Copy link
Contributor

Hi all!

I noticed that egrep command is issuing warnings when trying to create a ping resource on RHEL 10.0 beta,
and I have submitted a PR to address it.
ClusterLabs/pacemaker#3775

It seems that there are some RAs and test tools in resource-agents which use egrep/fgrep as well.

[root@rh10-b03 resource-agents]# find . -name '*' -type f | xargs grep -e 'egrep' -e 'fgrep'
./configure.ac:AC_PATH_PROGS(EGREP, egrep)
./configure.ac:if export -p | fgrep " CFLAGS=" > /dev/null; then
./heartbeat/IPaddr2:    if egrep -q "(^|,)${IP_INC_NO}(,|$)" $IP_CIP_FILE ; then
./heartbeat/ManageVE.in:`echo "$OCF_RESKEY_veid" | egrep -q '^[[:digit:]]+$'`
./heartbeat/SAPInstance:      if [ `echo "$SERVICE" | egrep -c "$SEARCH"` -eq 1 ]
./heartbeat/VirtualDomain:              elif echo "$migrate_opts" | fgrep -qs -- "--migrateuri="; then
./heartbeat/VirtualDomain:      DOMAIN_NAME=`egrep '[[:space:]]*<name>.*</name>[[:space:]]*$' ${OCF_RESKEY_config} 2>/dev/null | sed -e 's/[[:space:]]*<name>\(.*\)<\/name>[[:space:]]*$/\1/'`
./heartbeat/WAS:  netstat -ltnp  2>/dev/null| egrep -i "($pat) .*LISTEN" | sed 's%.*LISTEN *%%'
./heartbeat/WAS6:  netstat -ltnp  2>/dev/null| egrep -i "($pat) .*LISTEN" | sed 's%.*LISTEN *%%'
./heartbeat/docker:     docker images | awk '{print $1 ":" $2}' | egrep -q -s "^(docker.io\/|${SERVER_NAME}\/)?${IMAGE_NAME}:${IMAGE_TAG}\$"
./heartbeat/eDir88.in:        RET=$($NDSTRACE --config-file "$NDSCONF" -c modules | egrep -i '^vrdim.*Running' | awk '{print $1}')
./heartbeat/mysql-proxy:    echo $log_level | egrep -q "^(error|warning|info|message|debug|)$"
./heartbeat/portblock:  echo $1 |egrep -qx '[0-9]+(:[0-9]+)?(,[0-9]+(:[0-9]+)?)*'
./heartbeat/rabbitmq-server-ha:        echo "${pid_param}" | egrep -q '^[0-9]+$'
./heartbeat/sapdb.sh:        if [ `echo "$SERVICE" | egrep -c "$SEARCH"` -eq 1 ]
./heartbeat/smb-share.in:            if [ $(testparm -s 2>/dev/null| egrep -c \\[$OCF_RESKEY_share\\]) -eq 1 ];then
./heartbeat/smb-share.in:            if [ $(testparm -s 2>/dev/null| egrep -c \\[$OCF_RESKEY_share\\]) -eq 1 ];then
./heartbeat/symlink:    elif readlink -m "$OCF_RESKEY_link" | egrep -q "^$(readlink -m ${OCF_RESKEY_target})$"; then
./heartbeat/eDir88:        RET=$($NDSTRACE --config-file "$NDSCONF" -c modules | egrep -i '^vrdim.*Running' | awk '{print $1}')
./heartbeat/smb-share:            if [ $(testparm -s 2>/dev/null| egrep -c \\[$OCF_RESKEY_share\\]) -eq 1 ];then
./heartbeat/smb-share:            if [ $(testparm -s 2>/dev/null| egrep -c \\[$OCF_RESKEY_share\\]) -eq 1 ];then
./heartbeat/ManageVE:`echo "$OCF_RESKEY_veid" | egrep -q '^[[:digit:]]+$'`
./tools/ocft/apache:    if systemctl list-unit-files 2>/dev/null | fgrep -q apache2.service; then
./tools/ocft/iscsi:     if systemctl list-unit-files 2>/dev/null | fgrep -q iscsid.service; then
./tools/ocft/iscsi:     if systemctl list-unit-files 2>/dev/null | fgrep -q target.service; then
./tools/ocft/iscsi:     if systemctl list-unit-files 2>/dev/null | fgrep -q target.service; then
./tools/ocft/mysql:     if systemctl list-unit-files 2>/dev/null | fgrep -q mysql.service; then
: (snip)

It’s easy to replace them automatically.
However, due to limitations in my environment,
I am unfortunately only able to test some of them, not all.
Therefore, I am submitting this issue simply to inform you of the matter.
I would be glad if this can be of any help.

Regards,
Satomi OSAWA

@SatomiOSAWA SatomiOSAWA changed the title Would it be necessary to replace egrep with grep -E in resource-agents? Some resource agents still use egrep/fgrep. Dec 24, 2024
@oalbrigt oalbrigt self-assigned this Jan 20, 2025
@oalbrigt
Copy link
Contributor

I'll make a patch to fix it.

@SatomiOSAWA
Copy link
Contributor Author

@oalbrigt
Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants