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.

Bug 1095402

Summary: Postfix doesn't restart after package update due to incorrect postun script check
Product: Red Hat Enterprise Linux 6 Reporter: Jeff Sheltren <sheltren>
Component: postfixAssignee: Jaroslav Škarvada <jskarvad>
Status: CLOSED DUPLICATE QA Contact: qe-baseos-daemons
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.5CC: pknirsch
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-12-01 11:17:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jeff Sheltren 2014-05-07 15:37:12 UTC
On package update, postfix isn't restarted.

"service postfix status" returns: master dead but pid file exists

The process shows up in ps:
# ps ax | grep postfix
 3270 ?        Ss     0:22 /usr/libexec/postfix/master

However, looking at /proc/pid/exe shows:
lrwxrwxrwx. 1 root root 0 Apr  6 07:26 exe -> /usr/libexec/postfix/master (deleted)

I believe that at least part of the problem is the postun script in the postfix package is incorrect.  It's looking for "$1" != 0 -- but for the update case should actually be looking for "$1" != 1  (per http://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Syntax)

For example, rsyslog, which I know restarts correctly at package update uses the following snippet:

%postun
if [ "$1" -ge "1" ]; then
        service rsyslog condrestart > /dev/null 2>&1 ||:
fi

This seems like a similar bug report to #1067696, however I wanted to point out the postun check problem separately as it may or may not be in addition to some other bug with the restart/check.

Comment 3 Jaroslav Škarvada 2014-12-01 11:17:52 UTC
(In reply to Jeff Sheltren from comment #0)
Thanks for the report.

> I believe that at least part of the problem is the postun script in the
> postfix package is incorrect.  It's looking for "$1" != 0 -- but for the
> update case should actually be looking for "$1" != 1  (per
> http://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Syntax)
> 
I think it's correct, currently there is used:

  if [ "$1" != 0 ]; then
    /sbin/service postfix condrestart 2>&1 > /dev/null
  fi

This means: if $1 is not equal 0. It covers the case when $1 is equal 1, and it matches upgrade requirement from the Fedora guide. Changing it to $1" != 1 would match the case when $1 is equal to 0, which would match uninstall, so it wouldn't make sense.

> For example, rsyslog, which I know restarts correctly at package update uses
> the following snippet:
> 
> %postun
> if [ "$1" -ge "1" ]; then
>         service rsyslog condrestart > /dev/null 2>&1 ||:
> fi
> 

For $1 being 0 to 255, the [ "$1" -ge "1" ] is equal to [ "$1" != 0 ].

It seems the source of this problem is described in bug 1067696 comment 0.

*** This bug has been marked as a duplicate of bug 1067696 ***