Hide Forgot
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.
Created attachment 992105 [details] proposed patch for RHEL7 yum-utils-1.1.31-25.el7_0.noarch
Created attachment 992106 [details] proposed patch for RHEL6 yum-utils-1.1.30-30.el6.noarch
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
Created attachment 1187437 [details] downstream patch
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