Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Created attachment 865686[details]
proposed patch to work around package upate problem with status -b option
Description of problem:
new -b /path/to/binary option for status fail to give correct status info on package update.
Version-Release number of selected component (if applicable):
initscripts-9.03.40-2.el6_5.1
postfix-2.6.6-6.el6_5
rpm-4.8.0-37.el6
How reproducible:
Always.
Steps to Reproduce:
1. yum -y update
2. service postfix status
Actual results:
master dead but pid file exists
# lsof | grep master | grep delete
master 27440 root txt REG 253,0 171376 10229351 /usr/libexec/postfix/master (deleted)
# cat /var/spool/postfix/pid/master.pid
27440
Expected results:
New postfix running.
There are actually two bugs causing old postfix to run after package update.
But this status info actually shows what's wrong in status function when -b /path/to/binary is used and running binary has already been removed from filesystem.
Note: my patch is very simple, there is another way to fix this same issue in __readlink function by checking if there is match in ls -lb output for the binary name instaed of using $NF which prints "(delted)" in case of deleted binary.
Created attachment 865709[details]
alternate patch which also fixes the issue but doesn't break any functionality
This patch uses real readlink binary from coreutils (which is already required by initscripts).
Thanks for reporting this.
I would not use awk in this this case, since it does not work well will whitespaces.
[root@notas ~]$ /tmp/space\ sleep 50 &
[1] 6938
[root@notas ~]$ readlink /proc/6938/exe | awk '{ print $1 }'
/tmp/space
[root@notas ~]$ readlink /proc/6938/exe | sed -e 's/.*\s*(deleted)//'
/tmp/space sleep
That sed won't work because it maches whole string and not just the end.
$ readlink /proc/6063/exe
/usr/libexec/postfix/master (deleted)
$ readlink /proc/6063/exe | sed -e 's/.*\s*(deleted)//'
$
This sed would work:
$ readlink /proc/6063/exe | sed -e 's/\s*(deleted)//'
/usr/libexec/postfix/master
Even pure sh alternative would work for this case:
b=$(readlink /proc/6938/exe)
b=${b% (deleted)}
echo $b
/usr/libexec/postfix/master
(In reply to Tuomo Soini from comment #4)
> $ readlink /proc/6063/exe | sed -e 's/\s*(deleted)//'
> /usr/libexec/postfix/master
Not good. Should match only end of the string like my pure shell will do.
This is correct sed:
sed -e 's/\s*(deleted)$//'
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
http://rhn.redhat.com/errata/RHBA-2014-1448.html
Created attachment 865686 [details] proposed patch to work around package upate problem with status -b option Description of problem: new -b /path/to/binary option for status fail to give correct status info on package update. Version-Release number of selected component (if applicable): initscripts-9.03.40-2.el6_5.1 postfix-2.6.6-6.el6_5 rpm-4.8.0-37.el6 How reproducible: Always. Steps to Reproduce: 1. yum -y update 2. service postfix status Actual results: master dead but pid file exists # lsof | grep master | grep delete master 27440 root txt REG 253,0 171376 10229351 /usr/libexec/postfix/master (deleted) # cat /var/spool/postfix/pid/master.pid 27440 Expected results: New postfix running. There are actually two bugs causing old postfix to run after package update. But this status info actually shows what's wrong in status function when -b /path/to/binary is used and running binary has already been removed from filesystem. Note: my patch is very simple, there is another way to fix this same issue in __readlink function by checking if there is match in ls -lb output for the binary name instaed of using $NF which prints "(delted)" in case of deleted binary.