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 1115649

Summary: installation does not restart polkitd
Product: Red Hat Enterprise Linux 6 Reporter: Martin Žember <mzember>
Component: polkitAssignee: Miloslav Trmač <mitr>
Status: CLOSED ERRATA QA Contact: Karel Srot <ksrot>
Severity: high Docs Contact:
Priority: high    
Version: 6.7CC: ebenes, ksrot, mitr, salmy
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: polkit-0.96-11.el6 Doc Type: Bug Fix
Doc Text:
Cause: Consequence: The polkitd daemon was not restarted after upgrade of the polkit package, nor stopped after package uninstallation. Fix: Appropriate scriptlets were added to the polkit package. Result: The polkitd daemon is now stopped after package uninstallation, and will be restarted after future upgrades from this version of the polkit package.
Story Points: ---
Clone Of:
: 1198364 (view as bug list) Environment:
Last Closed: 2015-03-17 13:39:12 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 Martin Žember 2014-07-02 20:08:39 UTC
Description of problem:
When polkit is reinstalled/upgraded/downgraded, the old binary remains running.

Version-Release number of selected component (if applicable):
polkit-0.96-6.el6

How reproducible:
Always

Steps to Reproduce:
1. yum downgrade
2. use syntax that should not be known to the old version
3. polkit functions still work

OR:

1. ps ax | grep polkit
22488 ?        S      0:00 /usr/libexec/polkit-1/polkitd
22522 pts/0    S+     0:00 grep polkit
2. yum downgrade [path_to_rpm]
3. ps ax | grep polkit
22488 ?        S      0:00 /usr/libexec/polkit-1/polkitd
22528 pts/0    S+     0:00 grep polkit

The PIDs are the same.



Actual results:
Old binary is still running (the PIDs are the same).

Expected results:
Daemon is restarted.

Additional info:
# rpm -q --scripts polkit
postinstall program: /sbin/ldconfig
postuninstall program: /sbin/ldconfig

Comment 1 Martin Žember 2014-07-02 20:10:28 UTC
Workaround:
killall polkitd

Comment 3 Martin Žember 2014-07-02 20:56:01 UTC
When a policy/pkla file is changed, the change is detected automatically, but not immediately.

Comment 14 Karel Srot 2015-03-05 06:48:51 UTC
Hi Miloslav,
I am afraid that the if-then solution has one unpleasant side-effect, this time in relation with the preuninstall scriptlet.

    if [ -n "$pid" ]; then
        kill "$pid"
    fi

There is very small chance that the kill command would fail, e.g. because the polkitd process has been terminated right between the dbus-send query (and therefore $pid is set) and the kill command. If the kill command fails in the preun section then the uninstallation is aborted. Do you find it to be an expected/required behavior?

 [ -n "$pid" ] && kill "$pid" || :

has the advantage that it always pass.

Comment 15 Miloslav Trmač 2015-03-07 02:50:19 UTC
(In reply to Karel Srot from comment #14)
> I am afraid that the if-then solution has one unpleasant side-effect, this
> time in relation with the preuninstall scriptlet.
> 
>     if [ -n "$pid" ]; then
>         kill "$pid"
>     fi
> 
> There is very small chance that the kill command would fail, e.g. because
> the polkitd process has been terminated right between the dbus-send query
> (and therefore $pid is set) and the kill command. If the kill command fails
> in the preun section then the uninstallation is aborted. Do you find it to
> be an expected/required behavior?

No :)

>  [ -n "$pid" ] && kill "$pid" || :
> 
> has the advantage that it always pass.

OK, -11 does
>    if [ -n "$pid" ]; then
>        kill "$pid" 2>/dev/null || :
>    fi

Comment 21 errata-xmlrpc 2015-03-17 13:39:12 UTC
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.

https://rhn.redhat.com/errata/RHBA-2015-0692.html