Bug 1115649 - installation does not restart polkitd
Summary: installation does not restart polkitd
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: polkit
Version: 6.7
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Miloslav Trmač
QA Contact: Karel Srot
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-02 20:08 UTC by Martin Žember
Modified: 2015-07-13 04:14 UTC (History)
4 users (show)

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.
Clone Of:
: 1198364 (view as bug list)
Environment:
Last Closed: 2015-03-17 13:39:12 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0692 normal SHIPPED_LIVE polkit bug fix update 2015-03-17 17:38:51 UTC

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


Note You need to log in before you can comment on or make changes to this bug.