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