Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -u needrestart-3.4/ChangeLog needrestart-3.5/ChangeLog
- --- needrestart-3.4/ChangeLog 2019-02-05 22:35:46.000000000 +0100
- +++ needrestart-3.5/ChangeLog 2023-09-20 14:53:21.000000000 +0200
- @@ -1,4 +1,92 @@
- -needrestart (3.4) unstable; urgency=high
- +needrestart 3.6
- +
- + * Features:
- + - [Core] Add support for runit.
- + (Debian Bug#972685 by Lorenzo Puliti <plorenzo@disroot.org>)
- +
- + * Changes:
- + - [Cont] Improve LXD container support.
- + (github pull request #188 by James TD Smith @ahktenzero)
- + - [Cont] Update cgroup regex for LXC 4.0.
- + (github pull request #215 by James TD Smith @ahktenzero)
- + - [Core] Support systemd manager restart on Ubuntu 20.04+.
- + (github pull request #195 by Lars Kollstedt @LarsKollstedt)
- + - [Core] Do not restart bluetooth.service by default.
- + (github pull request #209 by Erik Tews @eriktews)
- + - [Core] Do not restart elogind by default.
- + (github issue #205 by @HumanG33k)
- + - [Kernel] Replace strings(1) by GNU grep to drop binutils dependency.
- + (Debian Bug#986507 by Trent W. Buck <trentbuck@gmail.com>)
- +
- + * Fixes:
- + - [Core] Fix comment for default value of `skip_mapfiles`.
- + (github pull request #179 by @iasdeoupxe)
- + - [Interp] Fix detection for ruby script started from relative paths.
- + (github pull request #182 by Alexander Neumann @rtpt-alex)
- + - [Core] Fix typos.
- + (github pull request #189 by @wwuck)
- + (github pull request #193 by Stefan Weil @stweil)
- + - [Core] Fix verbose/verbosity confusion in needrestart.conf.
- + (github pull request #197 by Jan-Philipp Litza @jplitza)
- + - [Core] Ignore memfd files like used by nvidia's binary drivers.
- + (github pull request #200 by Jan Visser @starquake)
- + - [Core] Ignore all memfd mappings.
- + (Debian Bug#972685 by Michail Bachmann <m.bachmann@cms.hu-berlin.de>)
- + - [Core] Ignore Java Native Access mappings.
- + (github issue #142 by @nirgal)
- + (github issue #185 by Ivan Zaera @izaera)
- +
- + -- Thomas Liske <thomas@fiasko-nw.net>
- +
- +needrestart 3.5
- +
- + * Features:
- + - [uCode] Check for pending AMD microcode updates (experimental).
- + (Debian Bug#886611 by Paul Wise <pabs@debian.org>)
- + (github issue #150 by Tom Reynolds @tomreyn and Mark Wagie @yochananmarqos)
- +
- + * Changes:
- + - [Core] Add network.service to blacklist.
- + (github pull request #145 by Marc Dequènes (Duck) @duck-rh)
- + - [uCode] Check microcode revision of each individual CPUs.
- + - [Kernel] Support kernel image filename filtering required for Raspbian.
- + (github issue #146 by @takichikawa)
- + (github issue #155 by Fenhl @fenhl and Christian @git-developer)
- + - [uCode] Support local override for iucode_tool call.
- + (github issue #148 by @mphilipps and Marc Dequènes (Duck) @duck-rh)
- + - [notify] Add app name to notify-send call.
- + (github issue #76 by @Vladimir-csp)
- +
- + * Fixes:
- + - [Core] Do not restart networking.service.
- + (Debian Bug#922725 by Timo Sigurdsson <public_timo.s@silentcreek.de>).
- + - [Core] Fix typo in man page for env variable DEBIAN_FRONT(END).
- + (Debian Bug#922864 by Lee Garrett <debian@rocketjump.eu>)
- + (Debian Bug#923853 by Petter Reinholdtsen <pere@hungry.com>)
- + - [Interp] Restore cwd when skipping processes with unavailable cwd.
- + (github issue #147 by Stavros Ntentos @stdedos)
- + - [Core] Remove leading zero before testing in map_files.
- + (Debian Bug#928225 by Alexander Galanin <al@galanin.nnov.ru>)
- + - [Core] Fix typos in ex/needrestart.conf.
- + (github pull request #163 by Simon Brand @brandsimon)
- + - [UI] Don't fail when terminal has zero columns width.
- + (github pull request #167 by @libnoon)
- + - [Core] Ignore mapped files not found on filesystem (stat) to suppress
- + chroot false positives.
- + (github issue #158 by @mphilipps)
- + (github issue #152 by Ivan Kurnosov @zerkms and @djl)
- + - [Core] Supress warnings from Proc::ProcessTable.
- + (github issue #170 by @mphilipps)
- + - [CONT] Fix docker detection on CentOS 7.
- + (github issue #165 by Christian Ruppert @idl0r)
- + - [notify] Fix notify-send not working with dbus-user-session.
- + (github issue #76 by @Vladimir-csp)
- + - [Core] Ignore mapped files in temporary directories.
- + (Debian Bug#925408 by Donald Pellegrino <donald.a.pellegrino@gmail.com>)
- +
- + -- Thomas Liske <thomas@fiasko-nw.net> Sun, 22 Mar 2020 17:36:57 +0100
- +
- +needrestart 3.4
- * Features:
- - [L10n] Add Czech localization.
- @@ -31,9 +119,9 @@
- - [Core] Do not restart oneshot services from systemd-cron.
- (Debian Bug#917073 by Antti Salmela <asalmela@iki.fi>)
- - -- Thomas Liske <thomas@fiasko-nw.net>
- + -- Thomas Liske <thomas@fiasko-nw.net> Tue, 05 Feb 2019 22:43:12 +0100
- -needrestart (3.3) unstable; urgency=high
- +needrestart 3.3
- * Fixes:
- - [Core] Configuration file is ignored.
- @@ -46,7 +134,7 @@
- -- Thomas Liske <thomas@fiasko-nw.net> Sun, 24 Jun 2018 13:32:47 +0200
- -needrestart (3.2) unstable; urgency=medium
- +needrestart 3.2
- * Changes:
- - [Kernel] Include /boot/kernel* while looking for linux
- @@ -74,7 +162,7 @@
- -- Thomas Liske <thomas@fiasko-nw.net> Sat, 16 Jun 2018 17:42:51 +0200
- -needrestart (3.1) unstable; urgency=high
- +needrestart 3.1
- * Changes:
- - [uCode] Handle microcode upgrades in early boot initrd images,
- @@ -91,7 +179,7 @@
- -- Thomas Liske <thomas@fiasko-nw.net> Thu, 29 Mar 2018 23:22:55 +0200
- -needrestart (3.0) unstable; urgency=medium
- +needrestart 3.0
- * Features:
- - [Core] Possible to suspend needrestart in apt-get hook using
- @@ -180,7 +268,7 @@
- -- Thomas Liske <thomas@fiasko-nw.net> Fri, 23 Feb 2018 13:38:46 +0100
- -needrestart (2.11) unstable; urgency=medium
- +needrestart 2.11
- * Features:
- - [Core] Allow special treatment to restart services (i.e. dbus).
- @@ -208,7 +296,7 @@
- -- Thomas Liske <thomas@fiasko-nw.net> Tue, 17 Jan 2017 15:59:36 +0100
- -needrestart (2.10) unstable; urgency=medium
- +needrestart 2.10
- * Features:
- - [Interp] Allow ignoring of interpreted files.
- @@ -232,7 +320,7 @@
- -- Thomas Liske <thomas@fiasko-nw.net> Thu, 03 Nov 2016 23:37:05 +0100
- -needrestart (2.9) unstable; urgency=medium
- +needrestart 2.9
- * Changes:
- - [l10n] Add RU translation for notify.d stuff.
- @@ -268,7 +356,7 @@
- -- Thomas Liske <thomas@fiasko-nw.net> Sat, 03 Sep 2016 14:52:41 +0200
- -needrestart (2.8) unstable; urgency=medium
- +needrestart 2.8
- * Changes:
- - [Core] Restart SysV init services on systemd using systemctl.
- @@ -306,7 +394,7 @@
- -- Thomas Liske <thomas@fiasko-nw.net> Mon, 16 May 2016 18:45:51 +0200
- -needrestart (2.7) unstable; urgency=medium
- +needrestart 2.7
- * [Bug] Ignore init rc being symlinks to upstart-job.
- (github issue #16 by Jonas Genannt @hggh)
- @@ -328,7 +416,7 @@
- -- Thomas Liske <thomas@fiasko-nw.net> Sun, 06 Mar 2016 14:46:45 +0100
- -needrestart (2.6) unstable; urgency=high
- +needrestart 2.6
- * [Bug] Do not notify system users via email.
- (Debian Bug#812399 by Marc Haber <mh+debian-packages@zugschlus.de>)
- @@ -341,14 +429,14 @@
- -- Thomas Liske <thomas@fiasko-nw.net> Wed, 17 Feb 2016 22:14:32 +0100
- -needrestart (2.5) unstable; urgency=medium
- +needrestart 2.5
- * [Bug] Fix broken kernel detection due to syntax error.
- (Debian Bug#810031 by Martin Steigerwald <martin@lichtvoll.de>)
- -- Thomas Liske <thomas@fiasko-nw.net> Tue, 05 Jan 2016 23:17:53 +0100
- -needrestart (2.4) unstable; urgency=medium
- +needrestart 2.4
- * [Bug] Drop unused dependency on File::Slurp.
- (Debian Bug#799733 by Christoph Anton Mitterer <calestyo@scientia.net>)
- @@ -365,7 +453,7 @@
- -- Thomas Liske <thomas@fiasko-nw.net> Fri, 01 Jan 2016 21:54:47 +0100
- -needrestart (2.3) unstable; urgency=medium
- +needrestart 2.3
- * [Bug] Add lightdm to override.
- (Debian Bug#791649 by Martin Steigerwald <martin@lichtvoll.de>)
- @@ -386,7 +474,7 @@
- -- Thomas Liske <thomas@fiasko-nw.net> Sat, 19 Sep 2015 20:38:19 +0200
- -needrestart (2.2) unstable; urgency=medium
- +needrestart 2.2
- * [regression] Processes using chroot were always detected as obsolete
- since missing binaries in /proc/PID/root/.
- @@ -394,7 +482,7 @@
- -- Thomas Liske <thomas@fiasko-nw.net> Tue, 26 May 2015 23:56:11 +0200
- -needrestart (2.1) unstable; urgency=medium
- +needrestart 2.1
- * [Bug] Ignore /usr/bin/apt-get.
- (Debian Bug#784237 by Thijs Kinkhorst <thijs@debian.org>)
- @@ -428,7 +516,7 @@
- -- Thomas Liske <thomas@fiasko-nw.net> Fri, 22 May 2015 01:45:17 +0200
- -needrestart (2.0) unstable; urgency=medium
- +needrestart 2.0
- * [regression] List commands in list mode.
- (Debian Bug#764042 by Paul Wise <pabs@debian.org>)
- @@ -454,7 +542,7 @@
- -- Thomas Liske <thomas@fiasko-nw.net> Fri, 23 Jan 2015 00:46:13 +0100
- -needrestart (1.2) unstable; urgency=medium
- +needrestart 1.2
- * Prepare po-debconf usage and add German translation.
- (Debian Bug#761068 by David Prévot <taffit@debian.org>)
- @@ -474,7 +562,7 @@
- -- Thomas Liske <thomas@fiasko-nw.net> Sun, 28 Sep 2014 23:48:42 +0200
- -needrestart (1.1) unstable; urgency=medium
- +needrestart 1.1
- * Ignore DHCP clients.
- (Debian Bug#752111 by Axel Beckert <abe@debian.org>)
- @@ -483,7 +571,7 @@
- -- Thomas Liske <thomas@fiasko-nw.net> Sat, 16 Aug 2014 09:57:29 +0200
- -needrestart (1.0) unstable; urgency=medium
- +needrestart 1.0
- * Fix grammar errors and use a additional debconf template.
- (Debian Bug#748652 by Justin B Rye <justin.byam.rye@gmail.com>)
- @@ -506,7 +594,7 @@
- -- Thomas Liske <thomas@fiasko-nw.net> Tue, 17 Jun 2014 15:21:15 +0200
- -needrestart (0.9) unstable; urgency=medium
- +needrestart 0.9
- * Drop external dependency on strings command from binutils.
- * Fix "uninitialized value" by apparent kernel threads.
- @@ -525,7 +613,7 @@
- -- Thomas Liske <thomas@fiasko-nw.net> Sun, 11 May 2014 22:48:42 +0200
- -needrestart (0.8) unstable; urgency=low
- +needrestart 0.8
- * Fix non-numeric argument on progress_prep call.
- (Debian Bug#744961 by Cristian Ionescu-Idbohrn
- @@ -543,7 +631,7 @@
- -- Thomas Liske <thomas@fiasko-nw.net> Sun, 27 Apr 2014 10:15:35 +0200
- -needrestart (0.7) unstable; urgency=medium
- +needrestart 0.7
- * Improved rc script detection, e.g.: previous releases failed to
- detect apache2's init script after upgrading libssl1.0.0.
- @@ -568,7 +656,7 @@
- -- Thomas Liske <thomas@fiasko-nw.net> Mon, 14 Apr 2014 21:50:15 +0200
- -needrestart (0.6) unstable; urgency=low
- +needrestart 0.6
- * Add lightdm to blacklist.
- (Debian Bug#735027 by Michael Gilbert <mgilbert@debian.org>)
- @@ -582,7 +670,7 @@
- -- Thomas Liske <thomas@fiasko-nw.net> Mon, 07 Apr 2014 22:52:18 +0200
- -needrestart (0.5) unstable; urgency=low
- +needrestart 0.5
- * Ignore mapped files in /tmp.
- * Handle LSB tags case insensitivly.
- @@ -594,7 +682,7 @@
- -- Thomas Liske <thomas@fiasko-nw.net> Thu, 02 Jan 2014 19:55:49 +0100
- -needrestart (0.4) unstable; urgency=low
- +needrestart 0.4
- * Fix spelling:
- - typo in debconf template (s/restartet/restarted/;)
- @@ -615,7 +703,7 @@
- -- Thomas Liske <thomas@fiasko-nw.net> Thu, 28 Nov 2013 19:30:06 +0100
- -needrestart (0.3) unstable; urgency=low
- +needrestart 0.3
- * Fix typo reported by Patrick Matthäi.
- * Add man page provided by Patrick Matthäi (Debian).
- @@ -633,7 +721,7 @@
- -- Thomas Liske <thomas@fiasko-nw.net> Sat, 14 Sep 2013 12:55:16 +0200
- -needrestart (0.2) unstable; urgency=low
- +needrestart 0.2
- * Support (l)ist only, (i)nteractive restart and
- (a)utomaticly restart modes.
- @@ -645,7 +733,7 @@
- -- Thomas Liske <thomas@fiasko-nw.net> Tue, 02 Apr 2013 21:51:48 +0200
- -needrestart (0.1) unstable; urgency=low
- +needrestart 0.1
- * Initial release.
- diff -u needrestart-3.4/COPYING needrestart-3.5/COPYING
- --- needrestart-3.4/COPYING 2019-02-05 22:35:46.000000000 +0100
- +++ needrestart-3.5/COPYING 2023-09-20 14:53:21.000000000 +0200
- @@ -1,12 +1,12 @@
- - GNU GENERAL PUBLIC LICENSE
- - Version 2, June 1991
- + GNU GENERAL PUBLIC LICENSE
- + Version 2, June 1991
- - Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- + Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
- - Preamble
- + Preamble
- The licenses for most software are designed to take away your
- freedom to share and change it. By contrast, the GNU General Public
- @@ -15,7 +15,7 @@
- General Public License applies to most of the Free Software
- Foundation's software and to any other program whose authors commit to
- using it. (Some other Free Software Foundation software is covered by
- -the GNU Library General Public License instead.) You can apply it to
- +the GNU Lesser General Public License instead.) You can apply it to
- your programs, too.
- When we speak of free software, we are referring to freedom, not
- @@ -55,8 +55,8 @@
- The precise terms and conditions for copying, distribution and
- modification follow.
- -
- - GNU GENERAL PUBLIC LICENSE
- +
- + GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
- 0. This License applies to any program or other work which contains
- @@ -110,7 +110,7 @@
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
- -
- +
- These requirements apply to the modified work as a whole. If
- identifiable sections of that work are not derived from the Program,
- and can be reasonably considered independent and separate works in
- @@ -168,7 +168,7 @@
- access to copy the source code from the same place counts as
- distribution of the source code, even though third parties are not
- compelled to copy the source along with the object code.
- -
- +
- 4. You may not copy, modify, sublicense, or distribute the Program
- except as expressly provided under this License. Any attempt
- otherwise to copy, modify, sublicense or distribute the Program is
- @@ -225,7 +225,7 @@
- This section is intended to make thoroughly clear what is believed to
- be a consequence of the rest of this License.
- -
- +
- 8. If the distribution and/or use of the Program is restricted in
- certain countries either by patents or by copyrighted interfaces, the
- original copyright holder who places the Program under this License
- @@ -255,7 +255,7 @@
- of preserving the free status of all derivatives of our free software and
- of promoting the sharing and reuse of software generally.
- - NO WARRANTY
- + NO WARRANTY
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
- FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
- @@ -277,9 +277,9 @@
- PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGES.
- - END OF TERMS AND CONDITIONS
- -
- - How to Apply These Terms to Your New Programs
- + END OF TERMS AND CONDITIONS
- +
- + How to Apply These Terms to Your New Programs
- If you develop a new program, and you want it to be of the greatest
- possible use to the public, the best way to achieve this is to make it
- @@ -303,17 +303,16 @@
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- - You should have received a copy of the GNU General Public License
- - along with this program; if not, write to the Free Software
- - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- -
- + You should have received a copy of the GNU General Public License along
- + with this program; if not, write to the Free Software Foundation, Inc.,
- + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- Also add information on how to contact you by electronic and paper mail.
- If the program is interactive, make it output a short notice like this
- when it starts in an interactive mode:
- - Gnomovision version 69, Copyright (C) year name of author
- + Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
- @@ -336,5 +335,5 @@
- This General Public License does not permit incorporating your program into
- proprietary programs. If your program is a subroutine library, you may
- consider it more useful to permit linking proprietary applications with the
- -library. If this is what you want to do, use the GNU Library General
- +library. If this is what you want to do, use the GNU Lesser General
- Public License instead of this License.
- Common subdirectories: needrestart-3.4/debian and needrestart-3.5/debian
- Common subdirectories: needrestart-3.4/ex and needrestart-3.5/ex
- Common subdirectories: needrestart-3.4/.github and needrestart-3.5/.github
- Common subdirectories: needrestart-3.4/hooks and needrestart-3.5/hooks
- Common subdirectories: needrestart-3.4/lib and needrestart-3.5/lib
- diff -u needrestart-3.4/Makefile needrestart-3.5/Makefile
- --- needrestart-3.4/Makefile 2019-02-05 22:35:46.000000000 +0100
- +++ needrestart-3.5/Makefile 2023-09-20 14:53:21.000000000 +0200
- @@ -1,7 +1,7 @@
- LOCALEDIR=/usr/share/locale
- all: mo-files
- - cd perl && perl Makefile.PL PREFIX=$(PREFIX) INSTALLDIRS=vendor
- + cd perl && perl Makefile.PL PREFIX=$(PREFIX) INSTALLDIRS=vendor
- cd perl && $(MAKE)
- install: all
- @@ -11,6 +11,7 @@
- cp hooks/* "$(DESTDIR)/etc/needrestart/hook.d/"
- cp ex/needrestart.conf "$(DESTDIR)/etc/needrestart/"
- cp ex/notify.conf "$(DESTDIR)/etc/needrestart/"
- + cp ex/iucode.sh "$(DESTDIR)/etc/needrestart/"
- mkdir -p "$(DESTDIR)/etc/needrestart/conf.d"
- cp ex/conf.d/* "$(DESTDIR)/etc/needrestart/conf.d/"
- mkdir -p "$(DESTDIR)/etc/needrestart/notify.d"
- Common subdirectories: needrestart-3.4/man and needrestart-3.5/man
- diff -u needrestart-3.4/needrestart needrestart-3.5/needrestart
- --- needrestart-3.4/needrestart 2023-09-20 14:56:45.563176846 +0200
- +++ needrestart-3.5/needrestart 2023-09-20 14:53:21.000000000 +0200
- @@ -8,7 +8,7 @@
- # Thomas Liske <thomas@fiasko-nw.net>
- #
- # Copyright Holder:
- -# 2013 - 2018 (C) Thomas Liske [http://fiasko-nw.net/~thomas/]
- +# 2013 - 2020 (C) Thomas Liske [http://fiasko-nw.net/~thomas/]
- #
- # License:
- # This program is free software; you can redistribute it and/or modify
- @@ -46,6 +46,7 @@
- my $LOGPREF = '[main]';
- my $is_systemd = -d q(/run/systemd/system);
- +my $is_runit = -e q(/run/runit.stopit);
- my $is_tty = (-t *STDERR || -t *STDOUT || -t *STDIN);
- my $is_vm;
- my $is_container;
- @@ -90,7 +91,8 @@
- a (a)utomatically restart
- -b enable batch mode
- -p enable nagios plugin mode
- - -f <fe> overwrite debconf frontend (DEBIAN_FRONTEND, debconf(7))
- + -f <fe> override debconf frontend (DEBIAN_FRONTEND, debconf(7))
- + -t <seconds> tolerate interpreter process start times within this value
- -u <ui> use preferred UI package (-u ? shows available packages)
- By using the following options only the specified checks are performed:
- @@ -113,7 +115,7 @@
- Thomas Liske <thomas\@fiasko-nw.net>
- Copyright Holder:
- - 2013 - 2018 (C) Thomas Liske [http://fiasko-nw.net/~thomas/]
- + 2013 - 2020 (C) Thomas Liske [http://fiasko-nw.net/~thomas/]
- Upstream:
- https://github.com/liske/needrestart
- @@ -143,18 +145,20 @@
- blacklist_mappings => [],
- override_rc => {},
- override_cont => {},
- - skip_mapfiles => 0,
- + skip_mapfiles => -1,
- interpscan => 1,
- kernelhints => 1,
- + kernelfilter => qr(.),
- ucodehints => 1,
- q(nagios-status) => {
- - services => 1,
- - kernel => 2,
- - ucode => 2,
- - sessions => 2,
- - containers => 1,
- + services => 1,
- + kernel => 2,
- + ucode => 2,
- + sessions => 2,
- + containers => 1,
- },
- has_pam_systemd => 1,
- + tolerance => 2,
- );
- # backup ARGV (required for Debconf)
- @@ -171,9 +175,10 @@
- our $opt_l;
- our $opt_p;
- our $opt_q;
- +our $opt_t;
- our $opt_u;
- our $opt_w;
- -unless(getopts('c:vr:nm:bf:klpqu:w')) {
- +unless(getopts('c:vr:nm:bf:klpqt:u:w')) {
- HELP_MESSAGE;
- exit 1;
- }
- @@ -186,7 +191,7 @@
- die "ERROR: Could not read config file '$opt_c'!\n" unless(-r $opt_c || $opt_b);
- -# overwrite debconf frontend
- +# override debconf frontend
- $ENV{DEBIAN_FRONTEND} = $opt_f if($opt_f);
- # be quiet
- @@ -218,10 +223,13 @@
- die "ERROR: Unknown restart option '$opt_r'!\n" unless($opt_r =~ /^(l|i|a)$/);
- $is_tty = 0 if($opt_r eq 'i' && exists($ENV{DEBIAN_FRONTEND}) && $ENV{DEBIAN_FRONTEND} eq 'noninteractive');
- $opt_r = 'l' if(!$is_tty && $opt_r eq 'i');
- +# always run in batch mode if we run noninteractive
- +$opt_b++ if(exists($ENV{DEBIAN_FRONTEND}) && $ENV{DEBIAN_FRONTEND} eq 'noninteractive');
- $opt_m = $nrconf{ui_mode} unless(defined($opt_m));
- die "ERROR: Unknown UI mode '$opt_m'!\n" unless($opt_m =~ /^(e|a)$/);
- $opt_r = 'l' if($opt_m eq 'e');
- +$opt_t = $nrconf{tolerance} unless(defined($opt_t));
- $nrconf{defno}++ if($opt_n);
- $opt_b++ if($opt_p);
- @@ -385,6 +393,14 @@
- (qw(systemctl restart), qq($rc.service));
- }
- }
- + elsif($is_runit && -d qq(/etc/sv/$rc)) {
- + if(-e qq(/etc/service/$rc)) {
- + (qw(sv restart), $rc);
- + }
- + else {
- + (q(service), $rc, q(restart));
- + }
- + }
- else {
- (q(invoke-rc.d), $rc, q(restart));
- }
- @@ -427,6 +443,7 @@
- my %restart;
- my %sessions;
- +my @guests;
- my @easy_hints;
- if(defined($opt_l)) {
- @@ -439,20 +456,20 @@
- sub findppid($@) {
- my $uid = shift;
- my ($pid, @pids) = @_;
- -
- +
- if($ptable->{$pid}->{ppid} == 1) {
- return $pid
- if($ptable->{$pid}->{uid} == $uid);
- -
- +
- return undef;
- }
- -
- +
- foreach my $pid (@pids) {
- my $ppid = &findppid($uid, $pid);
- -
- +
- return $ppid if($ppid);
- }
- -
- +
- return $pid;
- }
- @@ -509,9 +526,7 @@
- my @paths = ("/proc/$pid/map_files/$maddr", "/proc/$pid/root/$path");
- my ($testp) = grep { -e $_; } @paths;
- unless($testp) {
- - unless($path =~ m@^(/var)?/tmp/@ ||
- - $path =~ m@^(/var)?/run/@ ||
- - $nrconf{skip_mapfiles} == -1) {
- + unless($nrconf{skip_mapfiles} == -1) {
- print STDERR "$LOGPREF #$pid uses non-existing $path\n" if($nrconf{verbosity} > 1);
- $restart++;
- last;
- @@ -556,11 +571,11 @@
- }
- unless($restart || !$nrconf{interpscan}) {
- - $restart++ if(needrestart_interp_check($nrconf{verbosity} > 1, $pid, $exe, $nrconf{blacklist_interp}));
- + $restart++ if(needrestart_interp_check($nrconf{verbosity} > 1, $pid, $exe, $nrconf{blacklist_interp}, $opt_t));
- }
- # handle containers (LXC, docker, etc.)
- - next if($restart && needrestart_cont_check($nrconf{verbosity} > 1, $pid, $exe));
- + next if($restart && needrestart_cont_check($nrconf{verbosity} > 1, $pid, $exe, $opt_t));
- # restart needed?
- next unless($restart);
- @@ -605,7 +620,7 @@
- if(scalar keys %stage2 && !$uid) {
- $ui->progress_prep(scalar keys %stage2, __ 'Scanning candidates...');
- - foreach my $pid (sort {$a <=> $b} keys %stage2) {
- + PIDLOOP: foreach my $pid (sort {$a <=> $b} keys %stage2) {
- $ui->progress_step;
- # skip myself
- @@ -624,7 +639,7 @@
- if($is_systemd) {
- # systemd manager
- - if($pid == 1 && $exe =~ m@^/lib/systemd/systemd@) {
- + if($pid == 1 && $exe =~ m@^(/usr)?/lib/systemd/systemd@) {
- print STDERR "$LOGPREF #$pid is systemd manager\n" if($nrconf{verbosity} > 1);
- $restart{q(systemd-manager)}++;
- next;
- @@ -649,6 +664,25 @@
- push(@{ $sessions{$1}->{'user manager service'}->{ $ptable->{$pid}->{fname} } }, $pid);
- next;
- }
- + if($value =~ m@/machine.slice/machine.qemu(.*).scope@) {
- + for my $cmdlineidx (0 .. $#{$ptable->{$pid}->{cmdline}} ) {
- + if ( ${$ptable->{$pid}->{cmdline}}[$cmdlineidx] eq "-name") {
- + foreach ( split(/,/, ${$ptable->{$pid}->{cmdline}}[$cmdlineidx+1]) ) {
- + if ( index($_, "guest=") == 0 ) {
- + my @namearg = split(/=/, $_, 2);
- + if ($#{namearg} == 1) {
- + print STDERR "$LOGPREF #$pid detected as VM guest '$namearg[1]' in group '$value'\n" if($nrconf{verbosity} > 1);
- + push(@guests, __x("'{name}' with pid {pid}", name => $namearg[1], pid=>$pid) );
- + }
- + next PIDLOOP;
- + }
- + }
- + }
- + }
- + print STDERR "$LOGPREF #$pid detected as VM guest with unknown name in group '$value'\n" if($nrconf{verbosity} > 1);
- + push(@guests, __x("'Unkown VM' with pid {pid}", pid=>$pid) );
- + next;
- + }
- elsif($value =~ m@/([^/]+\.service)$@) {
- ($1);
- }
- @@ -718,7 +752,7 @@
- print STDERR "$LOGPREF no LSB headers found at $v[1]\n" if($nrconf{verbosity} > 1);
- push(@nopids, $v[1]);
- }
- - # In the run-levels S and 1 no daemons are being started (normaly).
- + # In the run-levels S and 1 no daemons are being started (normally).
- # We don't call any rc.d script not started in the current run-level.
- elsif($lsb{'default-start'} =~ /$runlevel/) {
- # If a pidfile has been found, try to look for the daemon and ignore
- @@ -749,10 +783,11 @@
- }
- # No perfect hit - call any rc scripts instead.
- + print STDERR "$LOGPREF #$pid running $hook no perfect hit found $found pids $#nopids\n" if($nrconf{verbosity} > 1);
- if(!$found && $#nopids > -1) {
- foreach my $rc (@nopids) {
- if($is_systemd && exists($restart{"$rc.service"})) {
- - print STDERR "$LOGPREF #$pid rc.d script $rc seems to be superseeded by $rc.service\n" if($nrconf{verbosity} > 1);
- + print STDERR "$LOGPREF #$pid rc.d script $rc seems to be superseded by $rc.service\n" if($nrconf{verbosity} > 1);
- }
- else {
- $restart{$rc}++;
- @@ -810,7 +845,7 @@
- }
- if(defined($opt_k)) {
- - my ($kresult, %kvars) = ($nrconf{kernelhints} || $opt_b ? nr_kernel_check($nrconf{verbosity} > 1, $ui) : ());
- + my ($kresult, %kvars) = ($nrconf{kernelhints} || $opt_b ? nr_kernel_check($nrconf{verbosity} > 1, $nrconf{kernelfilter}, $ui) : ());
- if(defined($kresult)) {
- if($opt_b) {
- @@ -970,7 +1005,7 @@
- $nagios{sstr} .= " (!!)";
- }
- }
- -
- +
- foreach my $rc (sort { lc($a) cmp lc($b) } keys %restart) {
- # always combine restarts in one systemctl command
- local $nrconf{systemctl_combine} = 1 unless($opt_r eq 'l');
- @@ -1253,6 +1288,25 @@
- }
- }
- }
- +
- + ## GUESTS
- + $ui->vspace();
- + if (! @guests) {
- + $ui->notice(__ 'No VM guests are running outdated hypervisor (qemu) binaries on this host.') unless($opt_b || $opt_m eq 'e');
- + }
- + else {
- + if($opt_m eq 'e') {
- + push(@easy_hints, __ 'outdated VM guests');
- + }
- + else {
- + unless($opt_p || $opt_b) {
- + $ui->notice(__ 'VM guests are running outdated hypervisor (qemu) binaries on this host:');
- + foreach ( @guests ) {
- + $ui->notice(" $_");
- + }
- + }
- + }
- + }
- }
- # easy mode: print hint on outdated stuff
- @@ -1262,6 +1316,27 @@
- $ui->announce_ehint(EHINT => ($h ? join(' ', $h, __ 'and', '') : '') . $t);
- }
- +my @sessions_list;
- +if(scalar %sessions) {
- + # build a sorted list of user @ session strings
- + #
- + # used in the nagios and batch outputs below
- + @sessions_list = map {
- + my $uid = $_;
- + my $user = uid2name($uid);
- + my @ret;
- +
- + foreach my $sess (sort keys %{ $sessions{$uid} }) {
- + push(@ret, "$user \@ $sess");
- + }
- +
- + @ret;
- + }
- + sort {
- + ncmp(uid2name($a), uid2name($b));
- + } keys %sessions
- +}
- +
- # nagios plugin output
- if($opt_p) {
- my %states = (
- @@ -1270,7 +1345,7 @@
- 2 => q(CRIT),
- 3 => q(UNKN),
- );
- - my ($ret) = reverse sort
- + my ($ret) = reverse sort
- (($opt_k ? $nagios{kret} : ()), ($opt_w ? $nagios{mret} : ()),
- ($opt_l ? ($nagios{sret}, $nagios{cret}, $nagios{uret}) : ()));
- @@ -1281,11 +1356,11 @@
- ($opt_l ? "Containers: $nagios{cstr}" : ()),
- ($opt_l ? "Sessions: $nagios{ustr}" : ()),
- ), '|', join(' ',
- - ($opt_k ? "Kernel=$nagios{kperf};0;;0;2" : ()),
- - ($opt_w ? "Microcode=$nagios{mperf};0;;0;1" : ()),
- - ($opt_l ? "Services=$nagios{sperf};;0;0" : ()),
- - ($opt_l ? "Containers=$nagios{cperf};;0;0" : ()),
- - ($opt_l ? "Sessions=$nagios{uperf};0;;0" : ()),
- + ( ($opt_k && $nagios{kret} != 3) ? "Kernel=$nagios{kperf};0;;0;2" : ()),
- + ( ($opt_w && $nagios{mret} != 3) ? "Microcode=$nagios{mperf};0;;0;1" : ()),
- + ( ($opt_l && $nagios{sret} != 3) ? "Services=$nagios{sperf};;0;0" : ()),
- + ( ($opt_l && $nagios{cret} != 3) ? "Containers=$nagios{cperf};;0;0" : ()),
- + ( ($opt_l && $nagios{uret} != 3) ? "Sessions=$nagios{uperf};0;;0" : ()),
- ), "\n";
- if(scalar %restart) {
- @@ -1298,22 +1373,14 @@
- }
- if(scalar %sessions) {
- - print "Sessions:", join("\n- ", '',
- - map {
- - my $uid = $_;
- - my $user = uid2name($uid);
- - my @ret;
- -
- - foreach my $sess (sort keys %{ $sessions{$uid} }) {
- - push(@ret, "$user \@ $sess");
- - }
- -
- - @ret;
- - }
- - sort {
- - ncmp(uid2name($a), uid2name($b));
- - } keys %sessions), "\n";
- + print "Sessions:", join("\n- ", '', @sessions_list), "\n";
- }
- exit $ret;
- }
- +
- +if ($opt_b and scalar %sessions) {
- + for my $sess (@sessions_list) {
- + print "NEEDRESTART-SESS: $sess\n";
- + }
- +}
- Binary files needrestart-3.4/.needrestart.swp and needrestart-3.5/.needrestart.swp differ
- diff -u needrestart-3.4/NEWS needrestart-3.5/NEWS
- --- needrestart-3.4/NEWS 2019-02-05 22:35:46.000000000 +0100
- +++ needrestart-3.5/NEWS 2023-09-20 14:53:21.000000000 +0200
- @@ -80,7 +80,7 @@
- blacklisting
- ------------
- -It might be a bad idea to (auto) restart certain daemons. Therefor
- +It might be a bad idea to (auto) restart certain daemons. Therefore
- a new config option is available to ignore binaries by matching
- a regex. The supplied default configuration ignores dbus, NetworkManager
- and various display managers.
- Common subdirectories: needrestart-3.4/.pc and needrestart-3.5/.pc
- Common subdirectories: needrestart-3.4/perl and needrestart-3.5/perl
- Common subdirectories: needrestart-3.4/po and needrestart-3.5/po
- diff -u needrestart-3.4/README.batch.md needrestart-3.5/README.batch.md
- --- needrestart-3.4/README.batch.md 2019-02-05 22:35:46.000000000 +0100
- +++ needrestart-3.5/README.batch.md 2023-09-20 14:53:21.000000000 +0200
- @@ -12,11 +12,13 @@
- NEEDRESTART-SVC: systemd-journald.service
- NEEDRESTART-SVC: systemd-machined.service
- NEEDRESTART-CONT: LXC web1
- +NEEDRESTART-SESS: metabase @ user manager service
- +NEEDRESTART-SESS: root @ session #28017
- ```
- Batch mode can be used to use the results of needrestart in other scripts.
- While needrestart is run in batch mode it will never show any UI dialogs
- -nor restart anything. The output format is complient to the
- +nor restart anything. The output format is compliant with the
- *apt-dater protocol*[1].
- [1] https://github.com/DE-IBH/apt-dater-host/blob/master/doc/
- diff -u needrestart-3.4/README.Cont.md needrestart-3.5/README.Cont.md
- --- needrestart-3.4/README.Cont.md 2019-02-05 22:35:46.000000000 +0100
- +++ needrestart-3.5/README.Cont.md 2023-09-20 14:53:21.000000000 +0200
- @@ -21,11 +21,13 @@
- NeedRestart::CONT::LXC
- ----------------------
- -Recognized by: cgroup path (`/lxc/*`)
- +Recognized by: cgroup path (`/lxc/*` || `/lxc.payload/*`)
- For each container which should be restarted needrestart calls
- `lxc-stop --reboot --name $NAME`.
- +This package also supports LXD containers, which are restarted by `lxc restart
- +$NAME` or `lxc restart --project=$PROJECT $NAME` for containers in projects.
- NeedRestart::CONT::machined
- ---------------------------
- diff -u needrestart-3.4/README.md needrestart-3.5/README.md
- --- needrestart-3.4/README.md 2019-02-05 22:35:46.000000000 +0100
- +++ needrestart-3.5/README.md 2023-09-20 14:53:21.000000000 +0200
- @@ -34,13 +34,13 @@
- * *rpm*
- * *pacman*
- -The *service* command is used to run the tradiditional System V init script.
- +The *service* command is used to run the traditional System V init script.
- Frontends
- ---------
- -*needrestart* uses a modular aproach based on perl packages providing
- +*needrestart* uses a modular approach based on perl packages providing
- the user interface. The following frontends are shipped:
- * *NeedRestart::UI::Debconf* using *debconf*
- @@ -50,9 +50,13 @@
- Kernel & Microcode
- ------------------
- -*needrestart* 0.8 brings a obsolete kernel detection feature. In *needrestart*
- -3.0 a [processor microcode update detection feature](README.uCode.md) for Intel
- -CPUs has been added.
- +*needrestart* 0.8 brings a obsolete kernel detection feature. Since
- +*needrestart* 3.5 it is possible to filter kernel image filenames (required on
- +[Raspberry Pi](README.raspberry.md)).
- +
- +In *needrestart* 3.0 a [processor microcode update detection
- +feature](README.uCode.md) for Intel CPUs has been added. Since *needrestart* 3.5
- +the AMD CPU support has been added.
- Interpreters
- Only in needrestart-3.5/: README.raspberry.md
- diff -u needrestart-3.4/README.uCode.md needrestart-3.5/README.uCode.md
- --- needrestart-3.4/README.uCode.md 2019-02-05 22:35:46.000000000 +0100
- +++ needrestart-3.5/README.uCode.md 2020-03-22 17:40:19.000000000 +0100
- @@ -5,7 +5,18 @@
- bugs. Needrestart checks if the current running microcode signature matches
- the most recent version available on the host.
- -The detection is currently only supported for Intel CPUs.
- +The detection is currently only supported for AMD and Intel CPUs.
- +
- +
- +AMD
- +---
- +
- +Needrestart decodes the AMD ucode firmware files to check for updates. This
- +requires to know the cpu's CPUID value. The most reliable way is to use the
- +cpuid kernel module (modprobe cpuid).
- +
- +As a fallback the CPUID is calculated from /proc/cpuinfo. The calculation
- +might be wrong and should be avoided by loading the cpuinfo kernel module.
- Intel
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement