Bug 1192946 - [RFE] needs-restarting should give a hint if reboot is required
Summary: [RFE] needs-restarting should give a hint if reboot is required
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: yum-utils   
(Show other bugs)
Version: 7.2
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Michal Domonkos
QA Contact: Eva Mrakova
Maxim Svistunov
URL:
Whiteboard:
Keywords: FutureFeature
Depends On:
Blocks: 1335587
TreeView+ depends on / blocked
 
Reported: 2015-02-16 10:04 UTC by Sebastian Hetze
Modified: 2016-11-04 00:13 UTC (History)
6 users (show)

Fixed In Version: yum-utils-1.1.31-40.el7
Doc Type: Release Note
Doc Text:
The *needs-restarting* utility has the new "--reboothint" option With this update, the *needs-restarting* utility has the new "--reboothint" option. Running "needs-restarting --reboothint" outputs a message saying which core packages have been updated since the last boot, if any, and thus whether a reboot is recommended. This helps the system administrator to find out whether they need to reboot the system to benefit from all updates. Note that the advice is only informational and does not mean it is strictly necessary to reboot the system immediately.
Story Points: ---
Clone Of:
: 1335587 1343389 (view as bug list)
Environment:
Last Closed: 2016-11-04 00:13:37 UTC
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
proposed patch for RHEL7 yum-utils-1.1.31-25.el7_0.noarch (4.78 KB, patch)
2015-02-16 10:05 UTC, Sebastian Hetze
no flags Details | Diff
proposed patch for RHEL6 yum-utils-1.1.30-30.el6.noarch (5.11 KB, patch)
2015-02-16 10:07 UTC, Sebastian Hetze
no flags Details | Diff
downstream patch (2.83 KB, patch)
2016-08-04 11:16 UTC, Michal Domonkos
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2187 normal SHIPPED_LIVE yum-utils bug fix and enhancement update 2016-11-03 13:18:35 UTC
Red Hat Knowledge Base (Solution) 27943 None None None 2016-02-25 10:24 UTC

Description Sebastian Hetze 2015-02-16 10:04:44 UTC
Description of problem:
needs-restarting returns a list of PID's that have updated/deleted files open due to an previous package upgrade.

https://access.redhat.com/solutions/27943 gives recommendations when in such cases a reboot is mandatory.

needs-restarting should display information in such a way that enables users to decide upon this recommendation and even better give a hint if reboot is required.

Version-Release number of selected component (if applicable):
yum-utils-1.1.30-30.el6.noarch
yum-utils-1.1.31-25.el7_0.noarch

How reproducible:
call needs-restarting on a system with recently upgraded glibc, kernel, hald,...

Actual results:
needs-restarting 
623 : /usr/sbin/NetworkManager --no-daemon 
607 : /usr/sbin/rsyslogd -n 
606 : avahi-daemon: running [rhel7.local]
1083 : /sbin/rpc.statd 
626 : avahi-daemon: chroot helper
752 : /usr/bin/python /usr/bin/gunicorn --access-logfile - --debug --max-requests 100 --graceful-timeout 3600 -t 3600 -k gevent -b 0.0.0.0:5000 -w 8 docker_registry.wsgi:application 
748 : /usr/bin/python /usr/bin/gunicorn --access-logfile - --debug --max-requests 100 --graceful-timeout 3600 -t 3600 -k gevent -b 0.0.0.0:5000 -w 8 docker_registry.wsgi:application 
763 : /usr/bin/python /usr/bin/gunicorn --access-logfile - --debug --max-requests 100 --graceful-timeout 3600 -t 3600 -k gevent -b 0.0.0.0:5000 -w 8 docker_registry.wsgi:application 
454 : /usr/lib/systemd/systemd-journald 
576 : /sbin/auditd -n 
661 : /sbin/iprdump --daemon 
4263 : /usr/lib/systemd/systemd-udevd 
2091 : -bash 
656 : /usr/lib/polkit-1/polkitd --no-debug 
691 : /sbin/dhclient -d -sf /usr/libexec/nm-dhcp-helper -pf /var/run/dhclient-eth0.pid -lf /var/lib/NetworkManager/dhclient-23d97fc4-ee0d-47db-9ce5-e701835ab9ca-eth0.lease -cf /var/lib/NetworkManager/dhclient-eth0.conf eth0 
808 : /usr/bin/python /usr/bin/gunicorn --access-logfile - --debug --max-requests 100 --graceful-timeout 3600 -t 3600 -k gevent -b 0.0.0.0:5000 -w 8 docker_registry.wsgi:application 
1 : /usr/lib/systemd/systemd --system --deserialize 27 
732 : /usr/bin/python /usr/bin/gunicorn --access-logfile - --debug --max-requests 100 --graceful-timeout 3600 -t 3600 -k gevent -b 0.0.0.0:5000 -w 8 docker_registry.wsgi:application 
631 : /sbin/agetty --noclear tty1 
609 : /usr/sbin/irqbalance --foreground 
610 : /usr/bin/python /usr/bin/gunicorn --access-logfile - --debug --max-requests 100 --graceful-timeout 3600 -t 3600 -k gevent -b 0.0.0.0:5000 -w 8 docker_registry.wsgi:application 
461 : /usr/sbin/lvmetad -f 
614 : /bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation 
608 : /usr/bin/python -Es /usr/sbin/tuned -l -P 
4232 : /usr/sbin/crond -n 
1516 : /usr/libexec/postfix/master -w 
783 : /usr/bin/python /usr/bin/gunicorn --access-logfile - --debug --max-requests 100 --graceful-timeout 3600 -t 3600 -k gevent -b 0.0.0.0:5000 -w 8 docker_registry.wsgi:application 
945 : /usr/sbin/sshd -D 
942 : /sbin/rpcbind -w  
2087 : sshd: root@pts/0     
725 : /usr/bin/python /usr/bin/gunicorn --access-logfile - --debug --max-requests 100 --graceful-timeout 3600 -t 3600 -k gevent -b 0.0.0.0:5000 -w 8 docker_registry.wsgi:application 
1519 : qmgr -l -t unix -u 
644 : /sbin/iprupdate --daemon 
646 : /sbin/iprinit --daemon 
801 : /usr/bin/python /usr/bin/gunicorn --access-logfile - --debug --max-requests 100 --graceful-timeout 3600 -t 3600 -k gevent -b 0.0.0.0:5000 -w 8 docker_registry.wsgi:application 
923 : /usr/bin/docker -d --selinux-enabled -H fd:// -H tcp://0.0.0.0:2375

Expected results:
needs-restarting -r
1 : glibc /usr/lib64/libnss_files-2.17.so -- /usr/lib/systemd/systemd --system --deserialize 27 
454 : glibc /usr/lib64/libpthread-2.17.so -- /usr/lib/systemd/systemd-journald 
461 : glibc /usr/lib64/librt-2.17.so -- /usr/sbin/lvmetad -f 
576 : glibc /usr/lib64/libnss_files-2.17.so -- /sbin/auditd -n 
606 : glibc /usr/lib64/libnss_files-2.17.so -- avahi-daemon: running [rhel7.local]
607 : glibc /usr/lib64/libc-2.17.so -- /usr/sbin/rsyslogd -n 
608 : systemd-libs /usr/lib64/libudev.so.1.4.0 -- /usr/bin/python -Es /usr/sbin/tuned -l -P 
609 : glibc /usr/lib64/libpthread-2.17.so -- /usr/sbin/irqbalance --foreground 
610 : glibc /usr/lib64/libresolv-2.17.so -- /usr/bin/python /usr/bin/gunicorn --access-logfile - --debug --max-requests 100 --graceful-timeout 3600 -t 3600 -k gevent -b 0.0.0.0:5000 -w 8 docker_registry.wsgi:application 
614 : glibc /usr/lib64/libnss_files-2.17.so -- /bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation 
623 : NetworkManager /usr/lib64/NetworkManager/libnm-wwan.so -- /usr/sbin/NetworkManager --no-daemon 
626 : glibc /usr/lib64/libnss_files-2.17.so -- avahi-daemon: chroot helper
631 : glibc-common /usr/lib/locale/locale-archive -- /sbin/agetty --noclear tty1 
644 : glibc /usr/lib64/libc-2.17.so -- /sbin/iprupdate --daemon 
646 : glibc /usr/lib64/libc-2.17.so -- /sbin/iprinit --daemon 
656 : glibc /usr/lib64/libnss_files-2.17.so -- /usr/lib/polkit-1/polkitd --no-debug 
661 : glibc /usr/lib64/libc-2.17.so -- /sbin/iprdump --daemon 
691 : glibc /usr/lib64/libnss_files-2.17.so -- /sbin/dhclient -d -sf /usr/libexec/nm-dhcp-helper -pf /var/run/dhclient-eth0.pid -lf /var/lib/NetworkManager/dhclient-23d97fc4-ee0d-47db-9ce5-e701835ab9ca-eth0.lease -cf /var/lib/NetworkManager/dhclient-eth0.conf eth0 
725 : libyaml /usr/lib64/libyaml-0.so.2.0.4 -- /usr/bin/python /usr/bin/gunicorn --access-logfile - --debug --max-requests 100 --graceful-timeout 3600 -t 3600 -k gevent -b 0.0.0.0:5000 -w 8 docker_registry.wsgi:application 
732 : libyaml /usr/lib64/libyaml-0.so.2.0.4 -- /usr/bin/python /usr/bin/gunicorn --access-logfile - --debug --max-requests 100 --graceful-timeout 3600 -t 3600 -k gevent -b 0.0.0.0:5000 -w 8 docker_registry.wsgi:application 
748 : libyaml /usr/lib64/libyaml-0.so.2.0.4 -- /usr/bin/python /usr/bin/gunicorn --access-logfile - --debug --max-requests 100 --graceful-timeout 3600 -t 3600 -k gevent -b 0.0.0.0:5000 -w 8 docker_registry.wsgi:application 
752 : libyaml /usr/lib64/libyaml-0.so.2.0.4 -- /usr/bin/python /usr/bin/gunicorn --access-logfile - --debug --max-requests 100 --graceful-timeout 3600 -t 3600 -k gevent -b 0.0.0.0:5000 -w 8 docker_registry.wsgi:application 
763 : libyaml /usr/lib64/libyaml-0.so.2.0.4 -- /usr/bin/python /usr/bin/gunicorn --access-logfile - --debug --max-requests 100 --graceful-timeout 3600 -t 3600 -k gevent -b 0.0.0.0:5000 -w 8 docker_registry.wsgi:application 
783 : libyaml /usr/lib64/libyaml-0.so.2.0.4 -- /usr/bin/python /usr/bin/gunicorn --access-logfile - --debug --max-requests 100 --graceful-timeout 3600 -t 3600 -k gevent -b 0.0.0.0:5000 -w 8 docker_registry.wsgi:application 
801 : libyaml /usr/lib64/libyaml-0.so.2.0.4 -- /usr/bin/python /usr/bin/gunicorn --access-logfile - --debug --max-requests 100 --graceful-timeout 3600 -t 3600 -k gevent -b 0.0.0.0:5000 -w 8 docker_registry.wsgi:application 
808 : libyaml /usr/lib64/libyaml-0.so.2.0.4 -- /usr/bin/python /usr/bin/gunicorn --access-logfile - --debug --max-requests 100 --graceful-timeout 3600 -t 3600 -k gevent -b 0.0.0.0:5000 -w 8 docker_registry.wsgi:application 
923 : glibc /usr/lib64/librt-2.17.so -- /usr/bin/docker -d --selinux-enabled -H fd:// -H tcp://0.0.0.0:2375 
942 : glibc /usr/lib64/libnss_files-2.17.so -- /sbin/rpcbind -w  
945 : glibc /usr/lib64/libnss_files-2.17.so -- /usr/sbin/sshd -D 
1083 : glibc /usr/lib64/libnss_files-2.17.so -- /sbin/rpc.statd 
1516 : glibc /usr/lib64/libnss_files-2.17.so -- /usr/libexec/postfix/master -w 
1519 : glibc /usr/lib64/libnss_files-2.17.so -- qmgr -l -t unix -u 
2087 : systemd-libs /usr/lib64/security/pam_systemd.so -- sshd: root@pts/0     
2091 : glibc /usr/lib64/libnss_files-2.17.so -- -bash 
4232 : glibc-common /usr/lib/locale/locale-archive -- /usr/sbin/crond -n 
4263 : selinux-policy-targeted /etc/selinux/targeted/contexts/files/file_contexts.bin -- /usr/lib/systemd/systemd-udevd 

  Caution!
  Kernel or core library packages have been updated!
  Reboot required!
  See https://access.redhat.com/solutions/27943 for details.


Additional info:
added a new option -r (--reboothint) to needs-restarting.py that adds the desired output.
Patches for RHEL6 and RHEL7 are attached.

Comment 1 Sebastian Hetze 2015-02-16 10:05:57 UTC
Created attachment 992105 [details]
proposed patch for RHEL7 yum-utils-1.1.31-25.el7_0.noarch

Comment 2 Sebastian Hetze 2015-02-16 10:07:47 UTC
Created attachment 992106 [details]
proposed patch for RHEL6 yum-utils-1.1.30-30.el6.noarch

Comment 11 Michal Domonkos 2016-05-19 13:08:34 UTC
Hey Sebastian,

I refactored your patch a little bit and created a pull request upstream [1].  Here's what I changed:

* instead of hardcoded color codes I used YumTerm which takes into account terminal capabilities and stuff

* removed the extra fields from the output; we're going to allow for showing these via a separate switch, see bug 1262691

* removed some unrelated stuff

Thank you for contributing!

[1] https://github.com/rpm-software-management/yum-utils/pull/8

Comment 17 Michal Domonkos 2016-08-04 11:16 UTC
Created attachment 1187437 [details]
downstream patch

Comment 23 errata-xmlrpc 2016-11-04 00:13:37 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-2016-2187.html


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