Bug 754169

Summary: needs-restarting should state that it needs root privileges
Product: [Fedora] Fedora Reporter: Kamil Páral <kparal>
Component: yum-utilsAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: emailjonathananderson-fedora, james.antill, joe, kylepablo, maxamillion, mitr, pmatilai, tim.lauridsen, vmukhame
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:2ebc07243755c1c950ee8c42a771d90c8d83f1b9
Fixed In Version: yum-utils-1.1.31-23.fc20 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-10 07:52:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Kamil Páral 2011-11-15 15:23:15 UTC
libreport version: 2.0.6
abrt_version:   2.0.4.981
cmdline:        /usr/bin/python -tt /usr/bin/needs-restarting
comment:        Run 'needs-restarting' as common user instead of root.
executable:     /usr/bin/needs-restarting
kernel:         3.1.1-1.fc16.x86_64
reason:         needs-restarting:84:get_open_files:IOError: [Errno 13] Permission denied
time:           Tue Nov 15 16:20:51 2011
uid:            500
username:       kparal

backtrace:
:needs-restarting:84:get_open_files:IOError: [Errno 13] Permission denied
:
:Traceback (most recent call last):
:  File "/usr/bin/needs-restarting", line 139, in <module>
:    sys.exit(main(sys.argv))
:  File "/usr/bin/needs-restarting", line 117, in main
:    for fn in get_open_files(pid):
:  File "/usr/bin/needs-restarting", line 84, in get_open_files
:    for line in maps.readlines():
:IOError: [Errno 13] Permission denied
:
:Local variables in innermost frame:
:files: []
:maps: <open file '/proc/1/smaps', mode 'r' at 0x1f52030>
:smaps: '/proc/1/smaps'
:pid: '1'

Comment 1 Jonathan 2011-11-22 12:37:35 UTC
Package: yum-utils-1.1.31-2.fc15
Architecture: x86_64
OS Release: Fedora release 15 (Lovelock)

Comment
-----
tried running "needs-restarting" as non-root

Comment 2 Joe Zeff 2011-12-25 01:28:52 UTC
I tried to run needs-restarting after a system update and it crashed.  It hasn't been working properly on this computer since I "upgraded" from Fedora 14 to Fedora 16.

rating: (null)
Package: yum-utils-1.1.31-2.fc16
Architecture: i686
OS Release: Fedora release 16 (Verne)

Comment 3 Miloslav Trmač 2012-02-10 18:24:44 UTC
Just ran the tools as an ordinary user

Package: yum-utils-1.1.31-2.fc16
OS Release: Fedora release 16 (Verne)

Comment 4 Fedora End Of Life 2013-01-16 17:33:30 UTC
This message is a reminder that Fedora 16 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 16. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '16'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 16's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 16 is end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" and open it against that version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 5 Miloslav Trmač 2013-01-16 18:41:33 UTC
Same in yum-utils-1.1.31-4.fc17.noarch

Comment 6 Fedora End Of Life 2013-07-04 03:24:58 UTC
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 is end of life. If you 
would still like  to see this bug fixed and are able to reproduce it 
against a later version  of Fedora, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 7 Miloslav Trmač 2013-07-04 13:31:26 UTC
No longer crashes with yum-utils-1.1.31-10.fc18.noarch, and seems to produce fairly reasonable output ("fairly" due to the screenful of "Could not open /proc/$pid/smaps" lines).  Thanks!

Comment 8 Fedora End Of Life 2013-08-01 10:55:09 UTC
Fedora 17 changed to end-of-life (EOL) status on 2013-07-30. Fedora 17 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 9 Kamil Páral 2013-08-01 11:56:25 UTC
It no longer crashes in F19, but it could at least end with a non-zero return code (and an explanatory message would even be better). Changing summary and tagging into rawhide. If it ends with 0 exit code, people might not notice it actually doesn't work, especially when used in scripts.

Comment 10 Fedora Update System 2014-05-22 14:24:22 UTC
yum-utils-1.1.31-22.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/yum-utils-1.1.31-22.fc20

Comment 11 Kyle Pablo 2014-05-23 01:28:54 UTC
Just tested yum-utils-1.1.31-22.fc20 as root and non-root.

As root, no problems.

As non-root I get:

$ needs-restarting --useronly
Traceback (most recent call last):
  File "/usr/bin/needs-restarting", line 178, in <module>
    sys.exit(main(sys.argv))
  File "/usr/bin/needs-restarting", line 124, in main
    for fn in get_open_files(pid):
  File "/usr/bin/needs-restarting", line 88, in get_open_files
    for line in maps:
IOError: [Errno 13] Permission denied

Comment 12 Jonathan 2014-05-23 07:19:01 UTC
Just some ignorant thoughts of mine. Would it be possible to provide different levels of functionality for root / user? When I use needs-restarting, I don't need a detailed answer that might warrant root privileges, but simply look for a "Yes, some package could use a restart". Could that be provided for user level?

Comment 13 Valentina Mukhamedzhanova 2014-05-23 13:27:18 UTC
Kyle, thank you for testing, I'll update the build.

Comment 14 Valentina Mukhamedzhanova 2014-05-23 14:15:50 UTC
https://admin.fedoraproject.org/updates/yum-utils-1.1.31-23.fc20 must fix the issue from c#11

Comment 15 Kyle Pablo 2014-05-23 15:35:13 UTC
(In reply to Valentina Mukhamedzhanova from comment #13)
> Kyle, thank you for testing, I'll update the build.

Fixed.  : )

Comment 16 Fedora Update System 2014-05-24 23:25:04 UTC
Package yum-utils-1.1.31-23.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing yum-utils-1.1.31-23.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-6637/yum-utils-1.1.31-23.fc20
then log in and leave karma (feedback).

Comment 17 Kyle Pablo 2014-05-25 00:32:16 UTC
Still get:

$ needs-restarting -u
Could not open /proc/1515/smaps
Could not open /proc/4783/smaps


with yum-utils-1.1.31-23.fc20

Comment 18 Kyle Pablo 2014-05-27 15:53:56 UTC
(In reply to Jonathan from comment #12)
> Just some ignorant thoughts of mine. Would it be possible to provide
> different levels of functionality for root / user? When I use
> needs-restarting, I don't need a detailed answer that might warrant root
> privileges, but simply look for a "Yes, some package could use a restart".
> Could that be provided for user level?


i agree. This would be a nice feature.  Better yet would be after running 'yum update' it would tell you need to restart or logout/in via cmd line.

Comment 19 Fedora Update System 2014-06-11 16:28:43 UTC
yum-utils-1.1.31-23.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.