Merge ~paelzer/ubuntu/+source/needrestart:update-jammy-to-git-1965090 into ubuntu/+source/needrestart:ubuntu/jammy-devel

Proposed by Christian Ehrhardt 
Status: Merged
Merge reported by: Christian Ehrhardt 
Merged at revision: fd9904a8c13dbe1fa5e27376921931e065bf6816
Proposed branch: ~paelzer/ubuntu/+source/needrestart:update-jammy-to-git-1965090
Merge into: ubuntu/+source/needrestart:ubuntu/jammy-devel
Diff against target: 2655 lines (+2411/-0)
40 files modified
debian/changelog (+9/-0)
debian/patches/Jammy-update-to-git-eb3531af-0003-Update-ChangeLog.patch (+294/-0)
debian/patches/Jammy-update-to-git-eb3531af-0004-Update-ChangeLog.patch (+29/-0)
debian/patches/Jammy-update-to-git-eb3531af-0005-Fix-typo.patch (+29/-0)
debian/patches/Jammy-update-to-git-eb3531af-0006-Support-LXD-installed-through-snap.patch (+59/-0)
debian/patches/Jammy-update-to-git-eb3531af-0007-Handle-differences-in-cgroup-names-for-LXD-container.patch (+31/-0)
debian/patches/Jammy-update-to-git-eb3531af-0008-Fix-restarting-for-containers-in-LXD-projects.patch (+44/-0)
debian/patches/Jammy-update-to-git-eb3531af-0009-Update-documentation-for-LXC-LXD-support.patch (+35/-0)
debian/patches/Jammy-update-to-git-eb3531af-0010-Fix-typo-in-German-translation.patch (+30/-0)
debian/patches/Jammy-update-to-git-eb3531af-0011-Update-ChangeLog.patch (+34/-0)
debian/patches/Jammy-update-to-git-eb3531af-0012-systemd-manager-restart-Support-also-exe-usr-lib-sys.patch (+33/-0)
debian/patches/Jammy-update-to-git-eb3531af-0014-Update-ChangeLog.patch (+43/-0)
debian/patches/Jammy-update-to-git-eb3531af-0015-Update-ChangeLog.patch (+29/-0)
debian/patches/Jammy-update-to-git-eb3531af-0017-Update-ChangeLog.patch (+29/-0)
debian/patches/Jammy-update-to-git-eb3531af-0020-Update-LXC-D-cgroup-regex-for-LXC-4.0.patch (+31/-0)
debian/patches/Jammy-update-to-git-eb3531af-0021-Do-not-restart-elogind-by-default-205.patch (+28/-0)
debian/patches/Jammy-update-to-git-eb3531af-0022-Update-ChangeLog.patch (+44/-0)
debian/patches/Jammy-update-to-git-eb3531af-0023-Ignore-Java-Native-Access-mappings-closes-142-closes.patch (+46/-0)
debian/patches/Jammy-update-to-git-eb3531af-0024-Use-license-file-from-gnu.org.patch (+138/-0)
debian/patches/Jammy-update-to-git-eb3531af-0025-Fix-spelling.patch (+117/-0)
debian/patches/Jammy-update-to-git-eb3531af-0026-Fix-shellcheck-warnings.patch (+187/-0)
debian/patches/Jammy-update-to-git-eb3531af-0027-Trim-excess-whitespace.patch (+161/-0)
debian/patches/Jammy-update-to-git-eb3531af-0028-Update-README.batch.md.patch (+30/-0)
debian/patches/Jammy-update-to-git-eb3531af-0029-Ignore-all-memfd-mappings-Debian-Bug-972685-by-Micha.patch (+46/-0)
debian/patches/Jammy-update-to-git-eb3531af-0030-Kernel-Replace-strings-1-by-GNU-grep-to-drop-binutil.patch (+45/-0)
debian/patches/Jammy-update-to-git-eb3531af-0031-Do-not-print-perfdata-if-unknown-state.patch (+41/-0)
debian/patches/Jammy-update-to-git-eb3531af-0032-Add-icinga2-example-config.patch (+58/-0)
debian/patches/Jammy-update-to-git-eb3531af-0033-also-output-user-sessions-in-batch-mode.patch (+100/-0)
debian/patches/Jammy-update-to-git-eb3531af-0034-Update-README.batch.md.patch (+32/-0)
debian/patches/Jammy-update-to-git-eb3531af-0035-use-a-configurable-tolerance-when-checking-interpret.patch (+127/-0)
debian/patches/Jammy-update-to-git-eb3531af-0036-Fix-docker-detection-on-newer-Kernels.patch (+38/-0)
debian/patches/Jammy-update-to-git-eb3531af-0037-Default-override-virtlogd-virtlockd.patch (+41/-0)
debian/patches/Jammy-update-to-git-eb3531af-0038-Detect-and-report-outdated-VMs.patch (+106/-0)
debian/patches/Jammy-update-to-git-eb3531af-0039-VM-detection-improve-wording.patch (+42/-0)
debian/patches/Jammy-update-to-git-eb3531af-0040-VM-detection-fix-whitespace-damage.patch (+30/-0)
debian/patches/Jammy-update-to-git-eb3531af-0041-VM-detection-do-not-localize-guests-that-are-found.patch (+30/-0)
debian/patches/Jammy-update-to-git-eb3531af-0042-VM-detection-localize-normal-output-of-vm-detection.patch (+39/-0)
debian/patches/Jammy-update-to-git-eb3531af-0043-Fix-LXC-LXD-and-machined-detection-for-cgroups-v2.patch (+48/-0)
debian/patches/Jammy-update-to-git-eb3531af-0044-Correct-syntax.patch (+37/-0)
debian/patches/series (+41/-0)
Reviewer Review Type Date Requested Status
Canonical Server packageset reviewers Pending
Canonical Server Pending
git-ubuntu import Pending
Review via email: mp+417078@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Got FFe and Foundations Team ack (on MM) - uploading now

Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading needrestart_3.5-5ubuntu2.dsc: done.
  Uploading needrestart_3.5-5ubuntu2.debian.tar.xz: done.
  Uploading needrestart_3.5-5ubuntu2_source.buildinfo: done.
  Uploading needrestart_3.5-5ubuntu2_source.changes: done.
Successfully uploaded packages.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 916fb2c..b9d6cf3 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,12 @@
6+needrestart (3.5-5ubuntu2) jammy; urgency=medium
7+
8+ * d/p/Jammy-update-to-git*: Update needrestart from git (LP: #1965090)
9+ - fixes handling with cgroupv2 for docker and lxd (LP: #1964445)
10+ - adds detection of qemu VMs using outdated libs
11+ - various minor fixes
12+
13+ -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Wed, 16 Mar 2022 08:53:23 +0100
14+
15 needrestart (3.5-5ubuntu1) jammy; urgency=low
16
17 * Merge from Debian unstable. Remaining changes:
18diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0003-Update-ChangeLog.patch b/debian/patches/Jammy-update-to-git-eb3531af-0003-Update-ChangeLog.patch
19new file mode 100644
20index 0000000..99b146f
21--- /dev/null
22+++ b/debian/patches/Jammy-update-to-git-eb3531af-0003-Update-ChangeLog.patch
23@@ -0,0 +1,294 @@
24+Description: backport from git to stabilize jammy
25+Origin: upstream, 0d6728c60799060e04d9bc082910caaf1ccb8ac5
26+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
27+Last-Update: 2022-03-16
28+From 0d6728c60799060e04d9bc082910caaf1ccb8ac5 Mon Sep 17 00:00:00 2001
29+From: Thomas Liske <thomas@fiasko-nw.net>
30+Date: Sun, 5 Jul 2020 10:16:54 +0200
31+Subject: [PATCH 03/43] Update ChangeLog.
32+
33+---
34+ ChangeLog | 68 +++++++++++++++++++++++++++++++------------------------
35+ 1 file changed, 38 insertions(+), 30 deletions(-)
36+
37+diff --git a/ChangeLog b/ChangeLog
38+index b3e7f65..d420a2e 100644
39+--- a/ChangeLog
40++++ b/ChangeLog
41+@@ -1,4 +1,12 @@
42+-needrestart (3.5) unstable; urgency=high
43++needrestart 3.6
44++
45++ * Fixes:
46++ - [Core] Fix comment for default value of `skip_mapfiles`.
47++ (github pull request #179 by @iasdeoupxe)
48++
49++ -- Thomas Liske <thomas@fiasko-nw.net>
50++
51++needrestart 3.5
52+
53+ * Features:
54+ - [uCode] Check for pending AMD microcode updates (experimental).
55+@@ -46,7 +54,7 @@ needrestart (3.5) unstable; urgency=high
56+
57+ -- Thomas Liske <thomas@fiasko-nw.net> Sun, 22 Mar 2020 17:36:57 +0100
58+
59+-needrestart (3.4) unstable; urgency=high
60++needrestart 3.4
61+
62+ * Features:
63+ - [L10n] Add Czech localization.
64+@@ -81,7 +89,7 @@ needrestart (3.4) unstable; urgency=high
65+
66+ -- Thomas Liske <thomas@fiasko-nw.net> Tue, 05 Feb 2019 22:43:12 +0100
67+
68+-needrestart (3.3) unstable; urgency=high
69++needrestart 3.3
70+
71+ * Fixes:
72+ - [Core] Configuration file is ignored.
73+@@ -94,7 +102,7 @@ needrestart (3.3) unstable; urgency=high
74+
75+ -- Thomas Liske <thomas@fiasko-nw.net> Sun, 24 Jun 2018 13:32:47 +0200
76+
77+-needrestart (3.2) unstable; urgency=medium
78++needrestart 3.2
79+
80+ * Changes:
81+ - [Kernel] Include /boot/kernel* while looking for linux
82+@@ -122,7 +130,7 @@ needrestart (3.2) unstable; urgency=medium
83+
84+ -- Thomas Liske <thomas@fiasko-nw.net> Sat, 16 Jun 2018 17:42:51 +0200
85+
86+-needrestart (3.1) unstable; urgency=high
87++needrestart 3.1
88+
89+ * Changes:
90+ - [uCode] Handle microcode upgrades in early boot initrd images,
91+@@ -139,7 +147,7 @@ needrestart (3.1) unstable; urgency=high
92+
93+ -- Thomas Liske <thomas@fiasko-nw.net> Thu, 29 Mar 2018 23:22:55 +0200
94+
95+-needrestart (3.0) unstable; urgency=medium
96++needrestart 3.0
97+
98+ * Features:
99+ - [Core] Possible to suspend needrestart in apt-get hook using
100+@@ -228,7 +236,7 @@ needrestart (3.0) unstable; urgency=medium
101+
102+ -- Thomas Liske <thomas@fiasko-nw.net> Fri, 23 Feb 2018 13:38:46 +0100
103+
104+-needrestart (2.11) unstable; urgency=medium
105++needrestart 2.11
106+
107+ * Features:
108+ - [Core] Allow special treatment to restart services (i.e. dbus).
109+@@ -256,7 +264,7 @@ needrestart (2.11) unstable; urgency=medium
110+
111+ -- Thomas Liske <thomas@fiasko-nw.net> Tue, 17 Jan 2017 15:59:36 +0100
112+
113+-needrestart (2.10) unstable; urgency=medium
114++needrestart 2.10
115+
116+ * Features:
117+ - [Interp] Allow ignoring of interpreted files.
118+@@ -280,7 +288,7 @@ needrestart (2.10) unstable; urgency=medium
119+
120+ -- Thomas Liske <thomas@fiasko-nw.net> Thu, 03 Nov 2016 23:37:05 +0100
121+
122+-needrestart (2.9) unstable; urgency=medium
123++needrestart 2.9
124+
125+ * Changes:
126+ - [l10n] Add RU translation for notify.d stuff.
127+@@ -316,7 +324,7 @@ needrestart (2.9) unstable; urgency=medium
128+
129+ -- Thomas Liske <thomas@fiasko-nw.net> Sat, 03 Sep 2016 14:52:41 +0200
130+
131+-needrestart (2.8) unstable; urgency=medium
132++needrestart 2.8
133+
134+ * Changes:
135+ - [Core] Restart SysV init services on systemd using systemctl.
136+@@ -354,7 +362,7 @@ needrestart (2.8) unstable; urgency=medium
137+
138+ -- Thomas Liske <thomas@fiasko-nw.net> Mon, 16 May 2016 18:45:51 +0200
139+
140+-needrestart (2.7) unstable; urgency=medium
141++needrestart 2.7
142+
143+ * [Bug] Ignore init rc being symlinks to upstart-job.
144+ (github issue #16 by Jonas Genannt @hggh)
145+@@ -376,7 +384,7 @@ needrestart (2.7) unstable; urgency=medium
146+
147+ -- Thomas Liske <thomas@fiasko-nw.net> Sun, 06 Mar 2016 14:46:45 +0100
148+
149+-needrestart (2.6) unstable; urgency=high
150++needrestart 2.6
151+
152+ * [Bug] Do not notify system users via email.
153+ (Debian Bug#812399 by Marc Haber <mh+debian-packages@zugschlus.de>)
154+@@ -389,14 +397,14 @@ needrestart (2.6) unstable; urgency=high
155+
156+ -- Thomas Liske <thomas@fiasko-nw.net> Wed, 17 Feb 2016 22:14:32 +0100
157+
158+-needrestart (2.5) unstable; urgency=medium
159++needrestart 2.5
160+
161+ * [Bug] Fix broken kernel detection due to syntax error.
162+ (Debian Bug#810031 by Martin Steigerwald <martin@lichtvoll.de>)
163+
164+ -- Thomas Liske <thomas@fiasko-nw.net> Tue, 05 Jan 2016 23:17:53 +0100
165+
166+-needrestart (2.4) unstable; urgency=medium
167++needrestart 2.4
168+
169+ * [Bug] Drop unused dependency on File::Slurp.
170+ (Debian Bug#799733 by Christoph Anton Mitterer <calestyo@scientia.net>)
171+@@ -413,7 +421,7 @@ needrestart (2.4) unstable; urgency=medium
172+
173+ -- Thomas Liske <thomas@fiasko-nw.net> Fri, 01 Jan 2016 21:54:47 +0100
174+
175+-needrestart (2.3) unstable; urgency=medium
176++needrestart 2.3
177+
178+ * [Bug] Add lightdm to override.
179+ (Debian Bug#791649 by Martin Steigerwald <martin@lichtvoll.de>)
180+@@ -434,7 +442,7 @@ needrestart (2.3) unstable; urgency=medium
181+
182+ -- Thomas Liske <thomas@fiasko-nw.net> Sat, 19 Sep 2015 20:38:19 +0200
183+
184+-needrestart (2.2) unstable; urgency=medium
185++needrestart 2.2
186+
187+ * [regression] Processes using chroot were always detected as obsolete
188+ since missing binaries in /proc/PID/root/.
189+@@ -442,7 +450,7 @@ needrestart (2.2) unstable; urgency=medium
190+
191+ -- Thomas Liske <thomas@fiasko-nw.net> Tue, 26 May 2015 23:56:11 +0200
192+
193+-needrestart (2.1) unstable; urgency=medium
194++needrestart 2.1
195+
196+ * [Bug] Ignore /usr/bin/apt-get.
197+ (Debian Bug#784237 by Thijs Kinkhorst <thijs@debian.org>)
198+@@ -476,7 +484,7 @@ needrestart (2.1) unstable; urgency=medium
199+
200+ -- Thomas Liske <thomas@fiasko-nw.net> Fri, 22 May 2015 01:45:17 +0200
201+
202+-needrestart (2.0) unstable; urgency=medium
203++needrestart 2.0
204+
205+ * [regression] List commands in list mode.
206+ (Debian Bug#764042 by Paul Wise <pabs@debian.org>)
207+@@ -502,7 +510,7 @@ needrestart (2.0) unstable; urgency=medium
208+
209+ -- Thomas Liske <thomas@fiasko-nw.net> Fri, 23 Jan 2015 00:46:13 +0100
210+
211+-needrestart (1.2) unstable; urgency=medium
212++needrestart 1.2
213+
214+ * Prepare po-debconf usage and add German translation.
215+ (Debian Bug#761068 by David Prévot <taffit@debian.org>)
216+@@ -522,7 +530,7 @@ needrestart (1.2) unstable; urgency=medium
217+
218+ -- Thomas Liske <thomas@fiasko-nw.net> Sun, 28 Sep 2014 23:48:42 +0200
219+
220+-needrestart (1.1) unstable; urgency=medium
221++needrestart 1.1
222+
223+ * Ignore DHCP clients.
224+ (Debian Bug#752111 by Axel Beckert <abe@debian.org>)
225+@@ -531,7 +539,7 @@ needrestart (1.1) unstable; urgency=medium
226+
227+ -- Thomas Liske <thomas@fiasko-nw.net> Sat, 16 Aug 2014 09:57:29 +0200
228+
229+-needrestart (1.0) unstable; urgency=medium
230++needrestart 1.0
231+
232+ * Fix grammar errors and use a additional debconf template.
233+ (Debian Bug#748652 by Justin B Rye <justin.byam.rye@gmail.com>)
234+@@ -554,7 +562,7 @@ needrestart (1.0) unstable; urgency=medium
235+
236+ -- Thomas Liske <thomas@fiasko-nw.net> Tue, 17 Jun 2014 15:21:15 +0200
237+
238+-needrestart (0.9) unstable; urgency=medium
239++needrestart 0.9
240+
241+ * Drop external dependency on strings command from binutils.
242+ * Fix "uninitialized value" by apparent kernel threads.
243+@@ -573,7 +581,7 @@ needrestart (0.9) unstable; urgency=medium
244+
245+ -- Thomas Liske <thomas@fiasko-nw.net> Sun, 11 May 2014 22:48:42 +0200
246+
247+-needrestart (0.8) unstable; urgency=low
248++needrestart 0.8
249+
250+ * Fix non-numeric argument on progress_prep call.
251+ (Debian Bug#744961 by Cristian Ionescu-Idbohrn
252+@@ -591,7 +599,7 @@ needrestart (0.8) unstable; urgency=low
253+
254+ -- Thomas Liske <thomas@fiasko-nw.net> Sun, 27 Apr 2014 10:15:35 +0200
255+
256+-needrestart (0.7) unstable; urgency=medium
257++needrestart 0.7
258+
259+ * Improved rc script detection, e.g.: previous releases failed to
260+ detect apache2's init script after upgrading libssl1.0.0.
261+@@ -616,7 +624,7 @@ needrestart (0.7) unstable; urgency=medium
262+
263+ -- Thomas Liske <thomas@fiasko-nw.net> Mon, 14 Apr 2014 21:50:15 +0200
264+
265+-needrestart (0.6) unstable; urgency=low
266++needrestart 0.6
267+
268+ * Add lightdm to blacklist.
269+ (Debian Bug#735027 by Michael Gilbert <mgilbert@debian.org>)
270+@@ -630,7 +638,7 @@ needrestart (0.6) unstable; urgency=low
271+
272+ -- Thomas Liske <thomas@fiasko-nw.net> Mon, 07 Apr 2014 22:52:18 +0200
273+
274+-needrestart (0.5) unstable; urgency=low
275++needrestart 0.5
276+
277+ * Ignore mapped files in /tmp.
278+ * Handle LSB tags case insensitivly.
279+@@ -642,7 +650,7 @@ needrestart (0.5) unstable; urgency=low
280+
281+ -- Thomas Liske <thomas@fiasko-nw.net> Thu, 02 Jan 2014 19:55:49 +0100
282+
283+-needrestart (0.4) unstable; urgency=low
284++needrestart 0.4
285+
286+ * Fix spelling:
287+ - typo in debconf template (s/restartet/restarted/;)
288+@@ -663,7 +671,7 @@ needrestart (0.4) unstable; urgency=low
289+
290+ -- Thomas Liske <thomas@fiasko-nw.net> Thu, 28 Nov 2013 19:30:06 +0100
291+
292+-needrestart (0.3) unstable; urgency=low
293++needrestart 0.3
294+
295+ * Fix typo reported by Patrick Matthäi.
296+ * Add man page provided by Patrick Matthäi (Debian).
297+@@ -681,7 +689,7 @@ needrestart (0.3) unstable; urgency=low
298+
299+ -- Thomas Liske <thomas@fiasko-nw.net> Sat, 14 Sep 2013 12:55:16 +0200
300+
301+-needrestart (0.2) unstable; urgency=low
302++needrestart 0.2
303+
304+ * Support (l)ist only, (i)nteractive restart and
305+ (a)utomaticly restart modes.
306+@@ -693,7 +701,7 @@ needrestart (0.2) unstable; urgency=low
307+
308+ -- Thomas Liske <thomas@fiasko-nw.net> Tue, 02 Apr 2013 21:51:48 +0200
309+
310+-needrestart (0.1) unstable; urgency=low
311++needrestart 0.1
312+
313+ * Initial release.
314+
315+--
316+2.35.1
317+
318diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0004-Update-ChangeLog.patch b/debian/patches/Jammy-update-to-git-eb3531af-0004-Update-ChangeLog.patch
319new file mode 100644
320index 0000000..9d76f9a
321--- /dev/null
322+++ b/debian/patches/Jammy-update-to-git-eb3531af-0004-Update-ChangeLog.patch
323@@ -0,0 +1,29 @@
324+Description: backport from git to stabilize jammy
325+Origin: upstream, fabe313cd38937f3cfaf360411dfdf1ded15d395
326+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
327+Last-Update: 2022-03-16
328+From fabe313cd38937f3cfaf360411dfdf1ded15d395 Mon Sep 17 00:00:00 2001
329+From: Thomas Liske <thomas@fiasko-nw.net>
330+Date: Sun, 5 Jul 2020 10:21:38 +0200
331+Subject: [PATCH 04/43] Update ChangeLog.
332+
333+---
334+ ChangeLog | 2 ++
335+ 1 file changed, 2 insertions(+)
336+
337+diff --git a/ChangeLog b/ChangeLog
338+index d420a2e..3500dbe 100644
339+--- a/ChangeLog
340++++ b/ChangeLog
341+@@ -3,6 +3,8 @@ needrestart 3.6
342+ * Fixes:
343+ - [Core] Fix comment for default value of `skip_mapfiles`.
344+ (github pull request #179 by @iasdeoupxe)
345++ - [Interp] Fix detection for ruby script started from relative paths.
346++ (github pull request #182 by Alexander Neumann @rtpt-alex)
347+
348+ -- Thomas Liske <thomas@fiasko-nw.net>
349+
350+--
351+2.35.1
352+
353diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0005-Fix-typo.patch b/debian/patches/Jammy-update-to-git-eb3531af-0005-Fix-typo.patch
354new file mode 100644
355index 0000000..220b132
356--- /dev/null
357+++ b/debian/patches/Jammy-update-to-git-eb3531af-0005-Fix-typo.patch
358@@ -0,0 +1,29 @@
359+Description: backport from git to stabilize jammy
360+Origin: upstream, e17fdb6aed5e60aa08583c3256df11b97667fa4d
361+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
362+Last-Update: 2022-03-16
363+From e17fdb6aed5e60aa08583c3256df11b97667fa4d Mon Sep 17 00:00:00 2001
364+From: wwuck <301402+wwuck@users.noreply.github.com>
365+Date: Thu, 9 Jul 2020 11:39:26 +1000
366+Subject: [PATCH 05/43] Fix typo
367+
368+---
369+ README.md | 2 +-
370+ 1 file changed, 1 insertion(+), 1 deletion(-)
371+
372+diff --git a/README.md b/README.md
373+index feffaf6..6c309b7 100644
374+--- a/README.md
375++++ b/README.md
376+@@ -34,7 +34,7 @@ hooks support the following package managers:
377+ * *rpm*
378+ * *pacman*
379+
380+-The *service* command is used to run the tradiditional System V init script.
381++The *service* command is used to run the traditional System V init script.
382+
383+
384+ Frontends
385+--
386+2.35.1
387+
388diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0006-Support-LXD-installed-through-snap.patch b/debian/patches/Jammy-update-to-git-eb3531af-0006-Support-LXD-installed-through-snap.patch
389new file mode 100644
390index 0000000..4a42d8e
391--- /dev/null
392+++ b/debian/patches/Jammy-update-to-git-eb3531af-0006-Support-LXD-installed-through-snap.patch
393@@ -0,0 +1,59 @@
394+Description: backport from git to stabilize jammy
395+Origin: upstream, 63cf8b28eb9083d2ef33dd3fa631e34415f5c342
396+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
397+Last-Update: 2022-03-16
398+From 63cf8b28eb9083d2ef33dd3fa631e34415f5c342 Mon Sep 17 00:00:00 2001
399+From: James TD Smith <ahktenzero@mohorovi.cc>
400+Date: Tue, 22 Oct 2019 15:15:03 +0100
401+Subject: [PATCH 06/43] Support LXD installed through snap
402+
403+This is the recommended way to install LXD and puts the container dirs in
404+/var/snap/lxd/common/lxd/containers instead of /var/lib/lxd/containers.
405+---
406+ perl/lib/NeedRestart/CONT/LXC.pm | 16 +++++++++++++---
407+ 1 file changed, 13 insertions(+), 3 deletions(-)
408+
409+diff --git a/perl/lib/NeedRestart/CONT/LXC.pm b/perl/lib/NeedRestart/CONT/LXC.pm
410+index c3b091d..2a7dd6c 100644
411+--- a/perl/lib/NeedRestart/CONT/LXC.pm
412++++ b/perl/lib/NeedRestart/CONT/LXC.pm
413+@@ -45,7 +45,16 @@ sub new {
414+ $self->{lxc} = {};
415+ $self->{lxd} = {};
416+
417+- $self->{has_lxd} = -x q(/usr/bin/lxc);
418++ if (-d q(/snap/lxd)) {
419++ $self->{has_lxd} = 1;
420++ $self->{lxd_bin} = q(/snap/bin/lxc);
421++ $self->{lxd_container_path} = q(/var/snap/lxd/common/lxd/containers);
422++ print STDERR "$LOGPREF LXD installed via snap\n" if($self->{debug});
423++ } else {
424++ $self->{has_lxd} = -x q(/usr/bin/lxc);
425++ $self->{lxd_bin} = q(/usr/bin/lxc);
426++ $self->{lxd_container_path} = q(/var/lib/lxd/containers);
427++ }
428+
429+ return bless $self, $class;
430+ }
431+@@ -75,7 +84,8 @@ sub check {
432+ return unless($cg =~ /^\d+:[^:]+:\/lxc\/([^\/\n]+)($|\/)/m);
433+
434+ my $name = $1;
435+- my $type = ($self->{has_lxd} && -d qq(/var/lib/lxd/containers/$name) ? 'LXD' : 'LXC');
436++ my $type = ($self->{has_lxd} && -d qq($self->{lxd_container_path}/$name) ? 'LXD' : 'LXC');
437++
438+ unless($norestart) {
439+ print STDERR "$LOGPREF #$pid is part of $type container '$name' and should be restarted\n" if($self->{debug});
440+
441+@@ -94,7 +104,7 @@ sub get {
442+ return (map {
443+ ($_ => [qw(lxc-stop --reboot --name), $_]);
444+ } keys %{ $self->{lxc} }), (map {
445+- ($_ => [qw(lxc restart), $_]);
446++ ($_ => [ $self->{lxd_bin}, "restart", $_]);
447+ } keys %{ $self->{lxd} });
448+ }
449+
450+--
451+2.35.1
452+
453diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0007-Handle-differences-in-cgroup-names-for-LXD-container.patch b/debian/patches/Jammy-update-to-git-eb3531af-0007-Handle-differences-in-cgroup-names-for-LXD-container.patch
454new file mode 100644
455index 0000000..c2eadaa
456--- /dev/null
457+++ b/debian/patches/Jammy-update-to-git-eb3531af-0007-Handle-differences-in-cgroup-names-for-LXD-container.patch
458@@ -0,0 +1,31 @@
459+Description: backport from git to stabilize jammy
460+Origin: upstream, 1f1bd6d4c539ec70ecfdb7efe69c37386475a71e
461+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
462+Last-Update: 2022-03-16
463+From 1f1bd6d4c539ec70ecfdb7efe69c37386475a71e Mon Sep 17 00:00:00 2001
464+From: James TD Smith <ahktenzero@mohorovi.cc>
465+Date: Tue, 22 Oct 2019 15:16:32 +0100
466+Subject: [PATCH 07/43] Handle differences in cgroup names for LXD containers
467+
468+LXC containers on newer versions of LXC are under the lxc.payload cgroup, update
469+the cgroup regex to match this too.
470+---
471+ perl/lib/NeedRestart/CONT/LXC.pm | 2 +-
472+ 1 file changed, 1 insertion(+), 1 deletion(-)
473+
474+diff --git a/perl/lib/NeedRestart/CONT/LXC.pm b/perl/lib/NeedRestart/CONT/LXC.pm
475+index 2a7dd6c..53a4dda 100644
476+--- a/perl/lib/NeedRestart/CONT/LXC.pm
477++++ b/perl/lib/NeedRestart/CONT/LXC.pm
478+@@ -81,7 +81,7 @@ sub check {
479+ }
480+
481+ # look for LXC cgroups
482+- return unless($cg =~ /^\d+:[^:]+:\/lxc\/([^\/\n]+)($|\/)/m);
483++ return unless($cg =~ /^\d+:[^:]+:\/lxc(?:.payload)?\/([^\/\n]+)($|\/)/m);
484+
485+ my $name = $1;
486+ my $type = ($self->{has_lxd} && -d qq($self->{lxd_container_path}/$name) ? 'LXD' : 'LXC');
487+--
488+2.35.1
489+
490diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0008-Fix-restarting-for-containers-in-LXD-projects.patch b/debian/patches/Jammy-update-to-git-eb3531af-0008-Fix-restarting-for-containers-in-LXD-projects.patch
491new file mode 100644
492index 0000000..3c6e70c
493--- /dev/null
494+++ b/debian/patches/Jammy-update-to-git-eb3531af-0008-Fix-restarting-for-containers-in-LXD-projects.patch
495@@ -0,0 +1,44 @@
496+Description: backport from git to stabilize jammy
497+Origin: upstream, 569d8d5fda5a4723a94be6b474eccd6c24ec5474
498+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
499+Last-Update: 2022-03-16
500+From 569d8d5fda5a4723a94be6b474eccd6c24ec5474 Mon Sep 17 00:00:00 2001
501+From: James TD Smith <ahktenzero@mohorovi.cc>
502+Date: Tue, 22 Oct 2019 15:36:17 +0100
503+Subject: [PATCH 08/43] Fix restarting for containers in LXD projects
504+
505+Check if containers are in a project and add the appropriate parameter to the
506+restart command.
507+---
508+ perl/lib/NeedRestart/CONT/LXC.pm | 12 +++++++++++-
509+ 1 file changed, 11 insertions(+), 1 deletion(-)
510+
511+diff --git a/perl/lib/NeedRestart/CONT/LXC.pm b/perl/lib/NeedRestart/CONT/LXC.pm
512+index 53a4dda..283d628 100644
513+--- a/perl/lib/NeedRestart/CONT/LXC.pm
514++++ b/perl/lib/NeedRestart/CONT/LXC.pm
515+@@ -101,10 +101,20 @@ sub check {
516+ sub get {
517+ my $self = shift;
518+
519++ sub lxd_restart_with_project {
520++ my ($bin, $container) = @_;
521++ my @parts = split(/_/, $container);
522++ if ($#parts == 1) {
523++ return [ $bin, 'restart', qq(--project=$parts[0]), $parts[1] ];
524++ } else {
525++ [ $bin, 'restart', $container ]
526++ }
527++ }
528++
529+ return (map {
530+ ($_ => [qw(lxc-stop --reboot --name), $_]);
531+ } keys %{ $self->{lxc} }), (map {
532+- ($_ => [ $self->{lxd_bin}, "restart", $_]);
533++ ($_ => lxd_restart_with_project($self->{lxd_bin}, $_));
534+ } keys %{ $self->{lxd} });
535+ }
536+
537+--
538+2.35.1
539+
540diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0009-Update-documentation-for-LXC-LXD-support.patch b/debian/patches/Jammy-update-to-git-eb3531af-0009-Update-documentation-for-LXC-LXD-support.patch
541new file mode 100644
542index 0000000..de45e90
543--- /dev/null
544+++ b/debian/patches/Jammy-update-to-git-eb3531af-0009-Update-documentation-for-LXC-LXD-support.patch
545@@ -0,0 +1,35 @@
546+Description: backport from git to stabilize jammy
547+Origin: upstream, 58d0d1609ac0c8e0588850ec416727f1365b438e
548+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
549+Last-Update: 2022-03-16
550+From 58d0d1609ac0c8e0588850ec416727f1365b438e Mon Sep 17 00:00:00 2001
551+From: James TD Smith <ahktenzero@mohorovi.cc>
552+Date: Tue, 22 Oct 2019 15:47:09 +0100
553+Subject: [PATCH 09/43] Update documentation for LXC/LXD support
554+
555+---
556+ README.Cont.md | 4 +++-
557+ 1 file changed, 3 insertions(+), 1 deletion(-)
558+
559+diff --git a/README.Cont.md b/README.Cont.md
560+index e2c06ec..dbc39df 100644
561+--- a/README.Cont.md
562++++ b/README.Cont.md
563+@@ -21,11 +21,13 @@ within docker containers by design.
564+ NeedRestart::CONT::LXC
565+ ----------------------
566+
567+-Recognized by: cgroup path (`/lxc/*`)
568++Recognized by: cgroup path (`/lxc/*` || `/lxc.payload/*`)
569+
570+ For each container which should be restarted needrestart calls
571+ `lxc-stop --reboot --name $NAME`.
572+
573++This package also supports LXD containers, which are restarted by `lxc restart
574++$NAME` or `lxc restart --project=$PROJECT $NAME` for containers in projects.
575+
576+ NeedRestart::CONT::machined
577+ ---------------------------
578+--
579+2.35.1
580+
581diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0010-Fix-typo-in-German-translation.patch b/debian/patches/Jammy-update-to-git-eb3531af-0010-Fix-typo-in-German-translation.patch
582new file mode 100644
583index 0000000..fcf28c6
584--- /dev/null
585+++ b/debian/patches/Jammy-update-to-git-eb3531af-0010-Fix-typo-in-German-translation.patch
586@@ -0,0 +1,30 @@
587+Description: backport from git to stabilize jammy
588+Origin: upstream, 712f2a30ae576745873e006e54fa49bcb81f3399
589+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
590+Last-Update: 2022-03-16
591+From 712f2a30ae576745873e006e54fa49bcb81f3399 Mon Sep 17 00:00:00 2001
592+From: Stefan Weil <sw@weilnetz.de>
593+Date: Thu, 3 Sep 2020 10:49:49 +0200
594+Subject: [PATCH 10/43] Fix typo in German translation
595+
596+Signed-off-by: Stefan Weil <sw@weilnetz.de>
597+---
598+ ex/debconf/po/de.po | 2 +-
599+ 1 file changed, 1 insertion(+), 1 deletion(-)
600+
601+diff --git a/ex/debconf/po/de.po b/ex/debconf/po/de.po
602+index 091ccbc..f8d06a8 100644
603+--- a/ex/debconf/po/de.po
604++++ b/ex/debconf/po/de.po
605+@@ -113,7 +113,7 @@ msgid ""
606+ "not the expected microcode revision ${AVAIL}."
607+ msgstr ""
608+ "Die laufende Prozessor Mikrocode-Revision ist ${CURRENT}, es wird jedoch die "
609+-"Revision ${AVAIL} erwaret."
610++"Revision ${AVAIL} erwartet."
611+
612+ #. Type: note
613+ #. Description
614+--
615+2.35.1
616+
617diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0011-Update-ChangeLog.patch b/debian/patches/Jammy-update-to-git-eb3531af-0011-Update-ChangeLog.patch
618new file mode 100644
619index 0000000..e049737
620--- /dev/null
621+++ b/debian/patches/Jammy-update-to-git-eb3531af-0011-Update-ChangeLog.patch
622@@ -0,0 +1,34 @@
623+Description: backport from git to stabilize jammy
624+Origin: upstream, 86802ac6e1eba092b4a27ffb28503083cce47ebc
625+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
626+Last-Update: 2022-03-16
627+From 86802ac6e1eba092b4a27ffb28503083cce47ebc Mon Sep 17 00:00:00 2001
628+From: Thomas Liske <thomas@fiasko-nw.net>
629+Date: Sat, 19 Sep 2020 19:26:10 +0200
630+Subject: [PATCH 11/43] Update ChangeLog.
631+
632+---
633+ ChangeLog | 7 +++++++
634+ 1 file changed, 7 insertions(+)
635+
636+diff --git a/ChangeLog b/ChangeLog
637+index 3500dbe..046bceb 100644
638+--- a/ChangeLog
639++++ b/ChangeLog
640+@@ -5,6 +5,13 @@ needrestart 3.6
641+ (github pull request #179 by @iasdeoupxe)
642+ - [Interp] Fix detection for ruby script started from relative paths.
643+ (github pull request #182 by Alexander Neumann @rtpt-alex)
644++ - [Cont] Improve LXD container support.
645++ (github pull request #188 by James TD Smith @ahktenzero)
646++
647++ * Fixes:
648++ - [Core] Fix typos.
649++ (github pull request #189 by @wwuck)
650++ (github pull request #193 by Stefan Weil @stweil)
651+
652+ -- Thomas Liske <thomas@fiasko-nw.net>
653+
654+--
655+2.35.1
656+
657diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0012-systemd-manager-restart-Support-also-exe-usr-lib-sys.patch b/debian/patches/Jammy-update-to-git-eb3531af-0012-systemd-manager-restart-Support-also-exe-usr-lib-sys.patch
658new file mode 100644
659index 0000000..6ff991c
660--- /dev/null
661+++ b/debian/patches/Jammy-update-to-git-eb3531af-0012-systemd-manager-restart-Support-also-exe-usr-lib-sys.patch
662@@ -0,0 +1,33 @@
663+Description: backport from git to stabilize jammy
664+Origin: upstream, 534513f31a8ee8ec60ee5acf842eeee6b0e86021
665+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
666+Last-Update: 2022-03-16
667+From 534513f31a8ee8ec60ee5acf842eeee6b0e86021 Mon Sep 17 00:00:00 2001
668+From: Lars Kollstedt <lk@man-da.de>
669+Date: Fri, 23 Oct 2020 16:47:13 +0200
670+Subject: [PATCH 12/43] systemd-manager restart: Support also exe =>
671+ /usr/lib/systemd/systemd
672+
673+In some cases especially Ubuntu 20.4 focal fossa the systemd process is
674+/usr/lib/systemd/systemd not /lib/systemd/systemd. That leads to
675+/etc/needrestart/restart.d/systemd-manager not beeing triggered.
676+---
677+ needrestart | 2 +-
678+ 1 file changed, 1 insertion(+), 1 deletion(-)
679+
680+diff --git a/needrestart b/needrestart
681+index d5c94fd..ec3cfad 100755
682+--- a/needrestart
683++++ b/needrestart
684+@@ -623,7 +623,7 @@ if(defined($opt_l)) {
685+
686+ if($is_systemd) {
687+ # systemd manager
688+- if($pid == 1 && $exe =~ m@^/lib/systemd/systemd@) {
689++ if($pid == 1 && $exe =~ m@^(/usr)?/lib/systemd/systemd@) {
690+ print STDERR "$LOGPREF #$pid is systemd manager\n" if($nrconf{verbosity} > 1);
691+ $restart{q(systemd-manager)}++;
692+ next;
693+--
694+2.35.1
695+
696diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0014-Update-ChangeLog.patch b/debian/patches/Jammy-update-to-git-eb3531af-0014-Update-ChangeLog.patch
697new file mode 100644
698index 0000000..57f6b9e
699--- /dev/null
700+++ b/debian/patches/Jammy-update-to-git-eb3531af-0014-Update-ChangeLog.patch
701@@ -0,0 +1,43 @@
702+Description: backport from git to stabilize jammy
703+Origin: upstream, 8af1eecd359339b6a52ede6fd6db2b0e7510fd94
704+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
705+Last-Update: 2022-03-16
706+From 8af1eecd359339b6a52ede6fd6db2b0e7510fd94 Mon Sep 17 00:00:00 2001
707+From: Thomas Liske <thomas@fiasko-nw.net>
708+Date: Thu, 29 Oct 2020 19:22:31 +0100
709+Subject: [PATCH 14/43] Update ChangeLog.
710+
711+---
712+ ChangeLog | 12 ++++++++----
713+ 1 file changed, 8 insertions(+), 4 deletions(-)
714+
715+diff --git a/ChangeLog b/ChangeLog
716+index 046bceb..1af55b8 100644
717+--- a/ChangeLog
718++++ b/ChangeLog
719+@@ -1,14 +1,18 @@
720+ needrestart 3.6
721+
722++ * Features:
723++ - [Core] Add support for runit.
724++ (Debian Bug#972685 by Lorenzo Puliti <plorenzo@disroot.org>)
725++
726++ * Changes:
727++ - [Cont] Improve LXD container support.
728++ (github pull request #188 by James TD Smith @ahktenzero)
729++
730+ * Fixes:
731+ - [Core] Fix comment for default value of `skip_mapfiles`.
732+ (github pull request #179 by @iasdeoupxe)
733+ - [Interp] Fix detection for ruby script started from relative paths.
734+ (github pull request #182 by Alexander Neumann @rtpt-alex)
735+- - [Cont] Improve LXD container support.
736+- (github pull request #188 by James TD Smith @ahktenzero)
737+-
738+- * Fixes:
739+ - [Core] Fix typos.
740+ (github pull request #189 by @wwuck)
741+ (github pull request #193 by Stefan Weil @stweil)
742+--
743+2.35.1
744+
745diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0015-Update-ChangeLog.patch b/debian/patches/Jammy-update-to-git-eb3531af-0015-Update-ChangeLog.patch
746new file mode 100644
747index 0000000..afa9bcd
748--- /dev/null
749+++ b/debian/patches/Jammy-update-to-git-eb3531af-0015-Update-ChangeLog.patch
750@@ -0,0 +1,29 @@
751+Description: backport from git to stabilize jammy
752+Origin: upstream, cecbe20782912cf88c19a35be2fdc4e16fe2e71f
753+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
754+Last-Update: 2022-03-16
755+From cecbe20782912cf88c19a35be2fdc4e16fe2e71f Mon Sep 17 00:00:00 2001
756+From: Thomas Liske <thomas@fiasko-nw.net>
757+Date: Thu, 29 Oct 2020 19:34:54 +0100
758+Subject: [PATCH 15/43] Update ChangeLog.
759+
760+---
761+ ChangeLog | 2 ++
762+ 1 file changed, 2 insertions(+)
763+
764+diff --git a/ChangeLog b/ChangeLog
765+index 1af55b8..21a4eaa 100644
766+--- a/ChangeLog
767++++ b/ChangeLog
768+@@ -7,6 +7,8 @@ needrestart 3.6
769+ * Changes:
770+ - [Cont] Improve LXD container support.
771+ (github pull request #188 by James TD Smith @ahktenzero)
772++ - [Core] Support systemd manager restart on Ubuntu 20.04+.
773++ (github pull request #195 by Lars Kollstedt @LarsKollstedt)
774+
775+ * Fixes:
776+ - [Core] Fix comment for default value of `skip_mapfiles`.
777+--
778+2.35.1
779+
780diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0017-Update-ChangeLog.patch b/debian/patches/Jammy-update-to-git-eb3531af-0017-Update-ChangeLog.patch
781new file mode 100644
782index 0000000..2a994d8
783--- /dev/null
784+++ b/debian/patches/Jammy-update-to-git-eb3531af-0017-Update-ChangeLog.patch
785@@ -0,0 +1,29 @@
786+Description: backport from git to stabilize jammy
787+Origin: upstream, 0a437275787f47a2af8d78d7463556b33a7ba1c0
788+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
789+Last-Update: 2022-03-16
790+From 0a437275787f47a2af8d78d7463556b33a7ba1c0 Mon Sep 17 00:00:00 2001
791+From: Thomas Liske <thomas@fiasko-nw.net>
792+Date: Mon, 23 Nov 2020 23:03:08 +0100
793+Subject: [PATCH 17/43] Update ChangeLog.
794+
795+---
796+ ChangeLog | 2 ++
797+ 1 file changed, 2 insertions(+)
798+
799+diff --git a/ChangeLog b/ChangeLog
800+index 21a4eaa..f8affd8 100644
801+--- a/ChangeLog
802++++ b/ChangeLog
803+@@ -18,6 +18,8 @@ needrestart 3.6
804+ - [Core] Fix typos.
805+ (github pull request #189 by @wwuck)
806+ (github pull request #193 by Stefan Weil @stweil)
807++ - [Core] Fix verbose/verbosity confusion in needrestart.conf.
808++ (github pull request #197 by Jan-Philipp Litza @jplitza)
809+
810+ -- Thomas Liske <thomas@fiasko-nw.net>
811+
812+--
813+2.35.1
814+
815diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0020-Update-LXC-D-cgroup-regex-for-LXC-4.0.patch b/debian/patches/Jammy-update-to-git-eb3531af-0020-Update-LXC-D-cgroup-regex-for-LXC-4.0.patch
816new file mode 100644
817index 0000000..6fd4bd6
818--- /dev/null
819+++ b/debian/patches/Jammy-update-to-git-eb3531af-0020-Update-LXC-D-cgroup-regex-for-LXC-4.0.patch
820@@ -0,0 +1,31 @@
821+Description: backport from git to stabilize jammy
822+Origin: upstream, d2c4096902ffd307823fcb58e31059e030fdcf48
823+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
824+Last-Update: 2022-03-16
825+From d2c4096902ffd307823fcb58e31059e030fdcf48 Mon Sep 17 00:00:00 2001
826+From: James TD Smith <ahktenzero@mohorovi.cc>
827+Date: Tue, 6 Jul 2021 16:54:30 +0100
828+Subject: [PATCH 20/43] Update LXC/D cgroup regex for LXC 4.0
829+
830+LXC 4.0 uses a flattened cgroup hierarchy (/lxc.payload.container1 vs
831+/lxc.payload/container1), update the regex to also match these names.
832+---
833+ perl/lib/NeedRestart/CONT/LXC.pm | 2 +-
834+ 1 file changed, 1 insertion(+), 1 deletion(-)
835+
836+diff --git a/perl/lib/NeedRestart/CONT/LXC.pm b/perl/lib/NeedRestart/CONT/LXC.pm
837+index 283d628..3f522ae 100644
838+--- a/perl/lib/NeedRestart/CONT/LXC.pm
839++++ b/perl/lib/NeedRestart/CONT/LXC.pm
840+@@ -81,7 +81,7 @@ sub check {
841+ }
842+
843+ # look for LXC cgroups
844+- return unless($cg =~ /^\d+:[^:]+:\/lxc(?:.payload)?\/([^\/\n]+)($|\/)/m);
845++ return unless($cg =~ /^\d+:[^:]+:\/lxc(?:.payload)?[.\/]([^\/\n]+)($|\/)/m);
846+
847+ my $name = $1;
848+ my $type = ($self->{has_lxd} && -d qq($self->{lxd_container_path}/$name) ? 'LXD' : 'LXC');
849+--
850+2.35.1
851+
852diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0021-Do-not-restart-elogind-by-default-205.patch b/debian/patches/Jammy-update-to-git-eb3531af-0021-Do-not-restart-elogind-by-default-205.patch
853new file mode 100644
854index 0000000..94fce56
855--- /dev/null
856+++ b/debian/patches/Jammy-update-to-git-eb3531af-0021-Do-not-restart-elogind-by-default-205.patch
857@@ -0,0 +1,28 @@
858+Description: backport from git to stabilize jammy
859+Origin: upstream, 48fdf7055b42790238306e18bd3e5758200d879f
860+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
861+Last-Update: 2022-03-16
862+From 48fdf7055b42790238306e18bd3e5758200d879f Mon Sep 17 00:00:00 2001
863+From: Thomas Liske <thomas@fiasko-nw.net>
864+Date: Sat, 18 Sep 2021 11:31:46 +0200
865+Subject: [PATCH 21/43] Do not restart elogind by default (#205).
866+
867+---
868+ ex/needrestart.conf | 1 +
869+ 1 file changed, 1 insertion(+)
870+
871+diff --git a/ex/needrestart.conf b/ex/needrestart.conf
872+index 4b2f6cb..b2d27a6 100644
873+--- a/ex/needrestart.conf
874++++ b/ex/needrestart.conf
875+@@ -115,6 +115,7 @@ $nrconf{override_rc} = {
876+ # (see also Debian Bug#784238 & #784437)
877+ qr(^emergency\.service$) => 0,
878+ qr(^rescue\.service$) => 0,
879++ qr(^elogind) => 0,
880+
881+ # do not restart oneshot services, see also #862840
882+ qr(^apt-daily\.service$) => 0,
883+--
884+2.35.1
885+
886diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0022-Update-ChangeLog.patch b/debian/patches/Jammy-update-to-git-eb3531af-0022-Update-ChangeLog.patch
887new file mode 100644
888index 0000000..76df37b
889--- /dev/null
890+++ b/debian/patches/Jammy-update-to-git-eb3531af-0022-Update-ChangeLog.patch
891@@ -0,0 +1,44 @@
892+Description: backport from git to stabilize jammy
893+Origin: upstream, 12a75cdbd78ca85cd2dae9fa1307afbb1c40a019
894+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
895+Last-Update: 2022-03-16
896+From 12a75cdbd78ca85cd2dae9fa1307afbb1c40a019 Mon Sep 17 00:00:00 2001
897+From: Thomas Liske <thomas@fiasko-nw.net>
898+Date: Sat, 18 Sep 2021 12:01:23 +0200
899+Subject: [PATCH 22/43] Update ChangeLog.
900+
901+---
902+ ChangeLog | 8 ++++++++
903+ 1 file changed, 8 insertions(+)
904+
905+diff --git a/ChangeLog b/ChangeLog
906+index f8affd8..ba99976 100644
907+--- a/ChangeLog
908++++ b/ChangeLog
909+@@ -7,8 +7,14 @@ needrestart 3.6
910+ * Changes:
911+ - [Cont] Improve LXD container support.
912+ (github pull request #188 by James TD Smith @ahktenzero)
913++ - [Cont] Update cgroup regex for LXC 4.0.
914++ (github pull request #215 by James TD Smith @ahktenzero)
915+ - [Core] Support systemd manager restart on Ubuntu 20.04+.
916+ (github pull request #195 by Lars Kollstedt @LarsKollstedt)
917++ - [Core] Do not restart bluetooth.service by default.
918++ (github pull request #209 by Erik Tews @eriktews)
919++ - [Core] Do not restart elogind by default.
920++ (github issue #205 by @HumanG33k)
921+
922+ * Fixes:
923+ - [Core] Fix comment for default value of `skip_mapfiles`.
924+@@ -20,6 +26,8 @@ needrestart 3.6
925+ (github pull request #193 by Stefan Weil @stweil)
926+ - [Core] Fix verbose/verbosity confusion in needrestart.conf.
927+ (github pull request #197 by Jan-Philipp Litza @jplitza)
928++ - [Core] Ignore memfd files like used by nvidia's binary drivers.
929++ (github pull request #200 by Jan Visser @starquake)
930+
931+ -- Thomas Liske <thomas@fiasko-nw.net>
932+
933+--
934+2.35.1
935+
936diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0023-Ignore-Java-Native-Access-mappings-closes-142-closes.patch b/debian/patches/Jammy-update-to-git-eb3531af-0023-Ignore-Java-Native-Access-mappings-closes-142-closes.patch
937new file mode 100644
938index 0000000..c217d71
939--- /dev/null
940+++ b/debian/patches/Jammy-update-to-git-eb3531af-0023-Ignore-Java-Native-Access-mappings-closes-142-closes.patch
941@@ -0,0 +1,46 @@
942+Description: backport from git to stabilize jammy
943+Origin: upstream, 30d3b27033bacfc7650690a92a132b8bfe977980
944+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
945+Last-Update: 2022-03-16
946+From 30d3b27033bacfc7650690a92a132b8bfe977980 Mon Sep 17 00:00:00 2001
947+From: Thomas Liske <thomas@fiasko-nw.net>
948+Date: Sat, 18 Sep 2021 12:21:57 +0200
949+Subject: [PATCH 23/43] Ignore Java Native Access mappings (closes #142, closes
950+ #185).
951+
952+---
953+ ChangeLog | 3 +++
954+ ex/needrestart.conf | 3 +++
955+ 2 files changed, 6 insertions(+)
956+
957+diff --git a/ChangeLog b/ChangeLog
958+index ba99976..cb1dbef 100644
959+--- a/ChangeLog
960++++ b/ChangeLog
961+@@ -28,6 +28,9 @@ needrestart 3.6
962+ (github pull request #197 by Jan-Philipp Litza @jplitza)
963+ - [Core] Ignore memfd files like used by nvidia's binary drivers.
964+ (github pull request #200 by Jan Visser @starquake)
965++ - [Core] Ignore Java Native Access mappings.
966++ (github issue #142 by @nirgal)
967++ (github issue #185 by Ivan Zaera @izaera)
968+
969+ -- Thomas Liske <thomas@fiasko-nw.net>
970+
971+diff --git a/ex/needrestart.conf b/ex/needrestart.conf
972+index b2d27a6..0852d27 100644
973+--- a/ex/needrestart.conf
974++++ b/ex/needrestart.conf
975+@@ -164,6 +164,9 @@ $nrconf{blacklist_mappings} = [
976+ # plasmashell (issue #65)
977+ qr(/#\d+( \(deleted\))?$),
978+
979++ # Java Native Access (issues #142 #185)
980++ qr#/jna\d+\.tmp( \(deleted\))?$#,
981++
982+ # temporary stuff
983+ qr#^(/var)?/tmp/#,
984+ qr#^(/var)?/run/#,
985+--
986+2.35.1
987+
988diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0024-Use-license-file-from-gnu.org.patch b/debian/patches/Jammy-update-to-git-eb3531af-0024-Use-license-file-from-gnu.org.patch
989new file mode 100644
990index 0000000..2dd53c8
991--- /dev/null
992+++ b/debian/patches/Jammy-update-to-git-eb3531af-0024-Use-license-file-from-gnu.org.patch
993@@ -0,0 +1,138 @@
994+Description: backport from git to stabilize jammy
995+Origin: upstream, bb7de6d8c0fbd328e413eef8e855a9b6e3bec642
996+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
997+Last-Update: 2022-03-16
998+From bb7de6d8c0fbd328e413eef8e855a9b6e3bec642 Mon Sep 17 00:00:00 2001
999+From: a1346054 <36859588+a1346054@users.noreply.github.com>
1000+Date: Sun, 22 Aug 2021 16:12:10 +0000
1001+Subject: [PATCH 24/43] Use license file from gnu.org
1002+
1003+Downloaded from:
1004+https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
1005+---
1006+ COPYING | 41 ++++++++++++++++++++---------------------
1007+ 1 file changed, 20 insertions(+), 21 deletions(-)
1008+
1009+diff --git a/COPYING b/COPYING
1010+index 623b625..d159169 100644
1011+--- a/COPYING
1012++++ b/COPYING
1013+@@ -1,12 +1,12 @@
1014+- GNU GENERAL PUBLIC LICENSE
1015+- Version 2, June 1991
1016++ GNU GENERAL PUBLIC LICENSE
1017++ Version 2, June 1991
1018+
1019+- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
1020+- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1021++ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
1022++ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1023+ Everyone is permitted to copy and distribute verbatim copies
1024+ of this license document, but changing it is not allowed.
1025+
1026+- Preamble
1027++ Preamble
1028+
1029+ The licenses for most software are designed to take away your
1030+ freedom to share and change it. By contrast, the GNU General Public
1031+@@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This
1032+ General Public License applies to most of the Free Software
1033+ Foundation's software and to any other program whose authors commit to
1034+ using it. (Some other Free Software Foundation software is covered by
1035+-the GNU Library General Public License instead.) You can apply it to
1036++the GNU Lesser General Public License instead.) You can apply it to
1037+ your programs, too.
1038+
1039+ When we speak of free software, we are referring to freedom, not
1040+@@ -55,8 +55,8 @@ patent must be licensed for everyone's free use or not licensed at all.
1041+
1042+ The precise terms and conditions for copying, distribution and
1043+ modification follow.
1044+-
1045
1046+- GNU GENERAL PUBLIC LICENSE
1047++
1048++ GNU GENERAL PUBLIC LICENSE
1049+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
1050+
1051+ 0. This License applies to any program or other work which contains
1052+@@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions:
1053+ License. (Exception: if the Program itself is interactive but
1054+ does not normally print such an announcement, your work based on
1055+ the Program is not required to print an announcement.)
1056+-
1057
1058++
1059+ These requirements apply to the modified work as a whole. If
1060+ identifiable sections of that work are not derived from the Program,
1061+ and can be reasonably considered independent and separate works in
1062+@@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent
1063+ access to copy the source code from the same place counts as
1064+ distribution of the source code, even though third parties are not
1065+ compelled to copy the source along with the object code.
1066+-
1067
1068++
1069+ 4. You may not copy, modify, sublicense, or distribute the Program
1070+ except as expressly provided under this License. Any attempt
1071+ otherwise to copy, modify, sublicense or distribute the Program is
1072+@@ -225,7 +225,7 @@ impose that choice.
1073+
1074+ This section is intended to make thoroughly clear what is believed to
1075+ be a consequence of the rest of this License.
1076+-
1077
1078++
1079+ 8. If the distribution and/or use of the Program is restricted in
1080+ certain countries either by patents or by copyrighted interfaces, the
1081+ original copyright holder who places the Program under this License
1082+@@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals
1083+ of preserving the free status of all derivatives of our free software and
1084+ of promoting the sharing and reuse of software generally.
1085+
1086+- NO WARRANTY
1087++ NO WARRANTY
1088+
1089+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
1090+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
1091+@@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
1092+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
1093+ POSSIBILITY OF SUCH DAMAGES.
1094+
1095+- END OF TERMS AND CONDITIONS
1096+-
1097
1098+- How to Apply These Terms to Your New Programs
1099++ END OF TERMS AND CONDITIONS
1100++
1101++ How to Apply These Terms to Your New Programs
1102+
1103+ If you develop a new program, and you want it to be of the greatest
1104+ possible use to the public, the best way to achieve this is to make it
1105+@@ -303,17 +303,16 @@ the "copyright" line and a pointer to where the full notice is found.
1106+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1107+ GNU General Public License for more details.
1108+
1109+- You should have received a copy of the GNU General Public License
1110+- along with this program; if not, write to the Free Software
1111+- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1112+-
1113++ You should have received a copy of the GNU General Public License along
1114++ with this program; if not, write to the Free Software Foundation, Inc.,
1115++ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1116+
1117+ Also add information on how to contact you by electronic and paper mail.
1118+
1119+ If the program is interactive, make it output a short notice like this
1120+ when it starts in an interactive mode:
1121+
1122+- Gnomovision version 69, Copyright (C) year name of author
1123++ Gnomovision version 69, Copyright (C) year name of author
1124+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
1125+ This is free software, and you are welcome to redistribute it
1126+ under certain conditions; type `show c' for details.
1127+@@ -336,5 +335,5 @@ necessary. Here is a sample; alter the names:
1128+ This General Public License does not permit incorporating your program into
1129+ proprietary programs. If your program is a subroutine library, you may
1130+ consider it more useful to permit linking proprietary applications with the
1131+-library. If this is what you want to do, use the GNU Library General
1132++library. If this is what you want to do, use the GNU Lesser General
1133+ Public License instead of this License.
1134+--
1135+2.35.1
1136+
1137diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0025-Fix-spelling.patch b/debian/patches/Jammy-update-to-git-eb3531af-0025-Fix-spelling.patch
1138new file mode 100644
1139index 0000000..1786c03
1140--- /dev/null
1141+++ b/debian/patches/Jammy-update-to-git-eb3531af-0025-Fix-spelling.patch
1142@@ -0,0 +1,117 @@
1143+Description: backport from git to stabilize jammy
1144+Origin: upstream, 2585279051fff5ac685fc0bcdc442d5ff3f1c311
1145+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
1146+Last-Update: 2022-03-16
1147+From 2585279051fff5ac685fc0bcdc442d5ff3f1c311 Mon Sep 17 00:00:00 2001
1148+From: a1346054 <36859588+a1346054@users.noreply.github.com>
1149+Date: Sun, 22 Aug 2021 16:20:54 +0000
1150+Subject: [PATCH 25/43] Fix spelling
1151+
1152+---
1153+ NEWS | 2 +-
1154+ README.batch.md | 2 +-
1155+ README.md | 2 +-
1156+ README.raspberry.md | 2 +-
1157+ ex/needrestart.conf | 4 ++--
1158+ needrestart | 4 ++--
1159+ 6 files changed, 8 insertions(+), 8 deletions(-)
1160+
1161+diff --git a/NEWS b/NEWS
1162+index 847495c..6f2e7ef 100644
1163+--- a/NEWS
1164++++ b/NEWS
1165+@@ -80,7 +80,7 @@ Changes in 0.3
1166+ blacklisting
1167+ ------------
1168+
1169+-It might be a bad idea to (auto) restart certain daemons. Therefor
1170++It might be a bad idea to (auto) restart certain daemons. Therefore
1171+ a new config option is available to ignore binaries by matching
1172+ a regex. The supplied default configuration ignores dbus, NetworkManager
1173+ and various display managers.
1174+diff --git a/README.batch.md b/README.batch.md
1175+index a837ced..88fcd4e 100644
1176+--- a/README.batch.md
1177++++ b/README.batch.md
1178+@@ -16,7 +16,7 @@ NEEDRESTART-CONT: LXC web1
1179+
1180+ Batch mode can be used to use the results of needrestart in other scripts.
1181+ While needrestart is run in batch mode it will never show any UI dialogs
1182+-nor restart anything. The output format is complient to the
1183++nor restart anything. The output format is complaint to the
1184+ *apt-dater protocol*[1].
1185+
1186+ [1] https://github.com/DE-IBH/apt-dater-host/blob/master/doc/
1187+diff --git a/README.md b/README.md
1188+index 6c309b7..8f01ee7 100644
1189+--- a/README.md
1190++++ b/README.md
1191+@@ -40,7 +40,7 @@ The *service* command is used to run the traditional System V init script.
1192+ Frontends
1193+ ---------
1194+
1195+-*needrestart* uses a modular aproach based on perl packages providing
1196++*needrestart* uses a modular approach based on perl packages providing
1197+ the user interface. The following frontends are shipped:
1198+
1199+ * *NeedRestart::UI::Debconf* using *debconf*
1200+diff --git a/README.raspberry.md b/README.raspberry.md
1201+index 35296be..b7d67db 100644
1202+--- a/README.raspberry.md
1203++++ b/README.raspberry.md
1204+@@ -1,7 +1,7 @@
1205+ needrestart - Raspberry Pi
1206+ ==========================
1207+
1208+-Raspbian and other linux distris are installing multiple kernel images in
1209++Raspbian and other linux distros are installing multiple kernel images in
1210+ parallel:
1211+
1212+ - `kernel.img`
1213+diff --git a/ex/needrestart.conf b/ex/needrestart.conf
1214+index 0852d27..cfe2b09 100644
1215+--- a/ex/needrestart.conf
1216++++ b/ex/needrestart.conf
1217+@@ -63,7 +63,7 @@ $nrconf{blacklist} = [
1218+ ];
1219+
1220+ # Blacklist services (list of regex) - USE WITH CARE.
1221+-# You should prefere to put services to $nrconf{override_rc} instead.
1222++# You should prefer to put services to $nrconf{override_rc} instead.
1223+ # Any service listed in $nrconf{blacklist_rc} will be ignored completely!
1224+ #$nrconf{blacklist_rc} = [
1225+ #];
1226+@@ -172,7 +172,7 @@ $nrconf{blacklist_mappings} = [
1227+ qr#^(/var)?/run/#,
1228+ ];
1229+
1230+-# Verify mapped files in fileystem:
1231++# Verify mapped files in filesystem:
1232+ # 0 : enabled
1233+ # -1: ignore non-existing files, workaround for chroots and broken grsecurity kernels (default)
1234+ # 1 : disable check completely, rely on content of maps file only
1235+diff --git a/needrestart b/needrestart
1236+index d33abc3..1524543 100755
1237+--- a/needrestart
1238++++ b/needrestart
1239+@@ -726,7 +726,7 @@ if(defined($opt_l)) {
1240+ print STDERR "$LOGPREF no LSB headers found at $v[1]\n" if($nrconf{verbosity} > 1);
1241+ push(@nopids, $v[1]);
1242+ }
1243+- # In the run-levels S and 1 no daemons are being started (normaly).
1244++ # In the run-levels S and 1 no daemons are being started (normally).
1245+ # We don't call any rc.d script not started in the current run-level.
1246+ elsif($lsb{'default-start'} =~ /$runlevel/) {
1247+ # If a pidfile has been found, try to look for the daemon and ignore
1248+@@ -760,7 +760,7 @@ if(defined($opt_l)) {
1249+ if(!$found && $#nopids > -1) {
1250+ foreach my $rc (@nopids) {
1251+ if($is_systemd && exists($restart{"$rc.service"})) {
1252+- print STDERR "$LOGPREF #$pid rc.d script $rc seems to be superseeded by $rc.service\n" if($nrconf{verbosity} > 1);
1253++ print STDERR "$LOGPREF #$pid rc.d script $rc seems to be superseded by $rc.service\n" if($nrconf{verbosity} > 1);
1254+ }
1255+ else {
1256+ $restart{$rc}++;
1257+--
1258+2.35.1
1259+
1260diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0026-Fix-shellcheck-warnings.patch b/debian/patches/Jammy-update-to-git-eb3531af-0026-Fix-shellcheck-warnings.patch
1261new file mode 100644
1262index 0000000..67bc278
1263--- /dev/null
1264+++ b/debian/patches/Jammy-update-to-git-eb3531af-0026-Fix-shellcheck-warnings.patch
1265@@ -0,0 +1,187 @@
1266+Description: backport from git to stabilize jammy
1267+Origin: upstream, 95d51c97ce94e1f1361c9b4db68fc9211d3a1ef4
1268+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
1269+Last-Update: 2022-03-16
1270+From 95d51c97ce94e1f1361c9b4db68fc9211d3a1ef4 Mon Sep 17 00:00:00 2001
1271+From: a1346054 <36859588+a1346054@users.noreply.github.com>
1272+Date: Sun, 22 Aug 2021 16:23:32 +0000
1273+Subject: [PATCH 26/43] Fix shellcheck warnings
1274+
1275+Additionally improves readability by removing mix of tabs vs
1276+spaces and adding indentation where needed.
1277+---
1278+ ex/apt/dpkg-status | 25 +++++++++++++----------
1279+ ex/notify.d/400-notify-send | 40 ++++++++++++++++++-------------------
1280+ ex/notify.d/600-mail | 4 ++--
1281+ ex/restart.d/dbus.service | 2 +-
1282+ lib/iucode-scan-versions | 4 ++--
1283+ lib/vmlinuz-get-version | 12 +++++------
1284+ 6 files changed, 44 insertions(+), 43 deletions(-)
1285+
1286+diff --git a/ex/apt/dpkg-status b/ex/apt/dpkg-status
1287+index b0f2527..79d12f6 100755
1288+--- a/ex/apt/dpkg-status
1289++++ b/ex/apt/dpkg-status
1290+@@ -23,17 +23,20 @@ touched=0
1291+ errored=0
1292+
1293+ while read tag p0 p1 p2 p3 p4 pp; do
1294+- if [ "$tag" = 'status:' -a "$p1" = 'unpacked' ]; then
1295+- if [ "$touched" = 0 ]; then
1296+- touch "$RUNDIR/unpacked"
1297+- touched=1
1298+- fi
1299++ if [ "$tag" = 'status:' ] && [ "$p1" = 'unpacked' ]; then
1300++ if [ "$touched" = 0 ]; then
1301++ touch "$RUNDIR/unpacked"
1302++ touched=1
1303++ fi
1304+ else
1305+- if [ "$tag" = 'status:' -a "$p1" = ':' -a "$p2" = 'error' -a "$p3" = ':' ]; then
1306+- if [ "$errored" = 0 ]; then
1307+- touch "$RUNDIR/errored"
1308+- errored=1
1309+- fi
1310+- fi
1311++ if [ "$tag" = 'status:' ] && \
1312++ [ "$p1" = ':' ] && \
1313++ [ "$p2" = 'error' ] && \
1314++ [ "$p3" = ':' ]; then
1315++ if [ "$errored" = 0 ]; then
1316++ touch "$RUNDIR/errored"
1317++ errored=1
1318++ fi
1319++ fi
1320+ fi
1321+ done
1322+diff --git a/ex/notify.d/400-notify-send b/ex/notify.d/400-notify-send
1323+index 932ea78..fb01202 100755
1324+--- a/ex/notify.d/400-notify-send
1325++++ b/ex/notify.d/400-notify-send
1326+@@ -28,30 +28,30 @@ if [ "$NR_NOTIFYD_DISABLE_NOTIFY_SEND" = '1' ]; then
1327+ fi
1328+
1329+ case "$NR_SESSION" in
1330+- session*)
1331+- DBUS_SESSION_BUS_ADDRESS=$(sed -z -n s/^DBUS_SESSION_BUS_ADDRESS=//p "/proc/$NR_SESSPPID/environ")
1332+- if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
1333+- unset DBUS_SESSION_BUS_ADDRESS
1334+- fi
1335++ session*)
1336++ DBUS_SESSION_BUS_ADDRESS=$(sed -z -n s/^DBUS_SESSION_BUS_ADDRESS=//p "/proc/$NR_SESSPPID/environ")
1337++ if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
1338++ unset DBUS_SESSION_BUS_ADDRESS
1339++ fi
1340+
1341+- export DISPLAY=$(sed -z -n s/^DISPLAY=//p "/proc/$NR_SESSPPID/environ")
1342+- export XAUTHORITY=$(sed -z -n s/^XAUTHORITY=//p "/proc/$NR_SESSPPID/environ")
1343++ export DISPLAY=$(sed -z -n s/^DISPLAY=//p "/proc/$NR_SESSPPID/environ")
1344++ export XAUTHORITY=$(sed -z -n s/^XAUTHORITY=//p "/proc/$NR_SESSPPID/environ")
1345+
1346+- if [ -z "$DISPLAY" ]; then
1347+- echo "[$0] could not find DISPLAY for $NR_USERNAME on $NR_SESSION" 1>&2
1348+- exit 1
1349+- fi
1350++ if [ -z "$DISPLAY" ]; then
1351++ echo "[$0] could not find DISPLAY for $NR_USERNAME on $NR_SESSION" 1>&2
1352++ exit 1
1353++ fi
1354+
1355+- echo "[$0] notify user $NR_USERNAME on $DISPLAY" 1>&2
1356++ echo "[$0] notify user $NR_USERNAME on $DISPLAY" 1>&2
1357+
1358+- MSGTITLE=$(gettext 'Relogin or restarts required!')
1359+- MSGBODY=$(gettext 'Your session is running obsolete binaries or libraries as listed below.
1360++ MSGTITLE=$(gettext 'Relogin or restarts required!')
1361++ MSGBODY=$(gettext 'Your session is running obsolete binaries or libraries as listed below.
1362+ <i><b>Please consider a relogin or restart of the affected processes!</b></i>')'\n'$(cat)
1363+
1364+- su -p -s /bin/sh -c "$NSEND -a needrestart -u critical -i dialog-warning \"$MSGTITLE\" \"$MSGBODY\"" "$NR_USERNAME"
1365+- ;;
1366+- *)
1367+- echo "[$0] skip session '$NR_SESSION'" 1>&2
1368+- exit 1;
1369+- ;;
1370++ su -p -s /bin/sh -c "$NSEND -a needrestart -u critical -i dialog-warning \"$MSGTITLE\" \"$MSGBODY\"" "$NR_USERNAME"
1371++ ;;
1372++ *)
1373++ echo "[$0] skip session '$NR_SESSION'" 1>&2
1374++ exit 1;
1375++ ;;
1376+ esac
1377+diff --git a/ex/notify.d/600-mail b/ex/notify.d/600-mail
1378+index 934e281..473065f 100755
1379+--- a/ex/notify.d/600-mail
1380++++ b/ex/notify.d/600-mail
1381+@@ -28,8 +28,8 @@ if [ "$NR_NOTIFYD_DISABLE_MAIL" = '1' ]; then
1382+ fi
1383+
1384+ # Skip system users
1385+-NR_USERID=`id -u "$NR_USERNAME"`
1386+-if [ "0$NR_USERID" -gt 0 -a "0$NR_USERID" -lt 1000 ]; then
1387++NR_USERID=$(id -u "$NR_USERNAME")
1388++if [ "0$NR_USERID" -gt 0 ] && [ "0$NR_USERID" -lt 1000 ]; then
1389+ echo "[$0] do not notify system-user $NR_USERNAME via mail" 1>&2
1390+ exit 1
1391+ fi
1392+diff --git a/ex/restart.d/dbus.service b/ex/restart.d/dbus.service
1393+index 2db103a..c40f599 100755
1394+--- a/ex/restart.d/dbus.service
1395++++ b/ex/restart.d/dbus.service
1396+@@ -19,7 +19,7 @@ RESTART_CHK="NetworkManager.service"
1397+ RESTART_SVC="systemd-logind.service systemd-journald.service"
1398+ for svc in $RESTART_CHK; do
1399+ if [ "$(systemctl show $svc --property=ActiveState)" = 'ActiveState=active' ]; then
1400+- RESTART_SVC="$RESTART_SVC $svc"
1401++ RESTART_SVC="$RESTART_SVC $svc"
1402+ fi
1403+ done
1404+
1405+diff --git a/lib/iucode-scan-versions b/lib/iucode-scan-versions
1406+index dc20c6a..2c3b142 100755
1407+--- a/lib/iucode-scan-versions
1408++++ b/lib/iucode-scan-versions
1409+@@ -29,9 +29,9 @@ if [ "$1" = "1" ]; then
1410+ fi
1411+
1412+ # filter for processor signature (and flags if available)
1413+-sig=`iucode_tool --scan-system 2>&1|grep -oE '[^[:space:]]+$'` #'
1414++sig=$(iucode_tool --scan-system 2>&1 | grep -oE '[^[:space:]]+$') #'
1415+ if [ -r /sys/devices/system/cpu/cpu0/microcode/processor_flags ]; then
1416+- filter="-s $sig,"`cat /sys/devices/system/cpu/cpu0/microcode/processor_flags`
1417++ filter="-s $sig,"$(cat /sys/devices/system/cpu/cpu0/microcode/processor_flags)
1418+ else
1419+ filter="-S"
1420+ fi
1421+diff --git a/lib/vmlinuz-get-version b/lib/vmlinuz-get-version
1422+index 22a4365..ec94fe7 100755
1423+--- a/lib/vmlinuz-get-version
1424++++ b/lib/vmlinuz-get-version
1425+@@ -29,19 +29,17 @@ try_decompress()
1426+ # "grep" that report the byte offset of the line instead of the pattern.
1427+
1428+ # Try to find the header ($1) and decompress from here
1429+- for pos in `tr "$1\n$2" "\n$2=" < "$img" | grep -abo "^$2"`
1430+- do
1431+- pos=${pos%%:*}
1432+- tail -c+$pos "$img" | $3 > $tmp 2> /dev/null
1433+- get_version $tmp
1434++ for pos in $(tr "$1\n$2" "\n$2=" < "$img" | grep -abo "^$2"); do
1435++ pos=${pos%%:*}
1436++ tail -c+$pos "$img" | $3 > $tmp 2>/dev/null
1437++ get_version $tmp
1438+ done
1439+ }
1440+
1441+ # Check invocation:
1442+ me=${0##*/}
1443+ img=$1
1444+-if [ $# -lt 1 -o $# -gt 2 -o ! -s "$img" ]
1445+-then
1446++if [ $# -lt 1 ] || [ $# -gt 2 ] || [ ! -s "$img" ]; then
1447+ echo "Usage: $me <kernel-image> [debug]" >&2
1448+ exit 2
1449+ fi
1450+--
1451+2.35.1
1452+
1453diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0027-Trim-excess-whitespace.patch b/debian/patches/Jammy-update-to-git-eb3531af-0027-Trim-excess-whitespace.patch
1454new file mode 100644
1455index 0000000..a02f8ae
1456--- /dev/null
1457+++ b/debian/patches/Jammy-update-to-git-eb3531af-0027-Trim-excess-whitespace.patch
1458@@ -0,0 +1,161 @@
1459+Description: backport from git to stabilize jammy
1460+Origin: upstream, 0880b05c1b83ccc442f683c84a60449f489e8be4
1461+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
1462+Last-Update: 2022-03-16
1463+From 0880b05c1b83ccc442f683c84a60449f489e8be4 Mon Sep 17 00:00:00 2001
1464+From: a1346054 <36859588+a1346054@users.noreply.github.com>
1465+Date: Sun, 22 Aug 2021 16:24:58 +0000
1466+Subject: [PATCH 27/43] Trim excess whitespace
1467+
1468+---
1469+ Makefile | 2 +-
1470+ ex/needrestart.conf | 1 -
1471+ needrestart | 14 +++++++-------
1472+ perl/lib/NeedRestart.pm | 2 +-
1473+ perl/lib/NeedRestart/Interp/Python.pm | 6 +++---
1474+ perl/lib/NeedRestart/Interp/Ruby.pm | 2 +-
1475+ perl/lib/NeedRestart/Kernel.pm | 2 +-
1476+ 7 files changed, 14 insertions(+), 15 deletions(-)
1477+
1478+diff --git a/Makefile b/Makefile
1479+index c687d92..61841a1 100644
1480+--- a/Makefile
1481++++ b/Makefile
1482+@@ -1,7 +1,7 @@
1483+ LOCALEDIR=/usr/share/locale
1484+
1485+ all: mo-files
1486+- cd perl && perl Makefile.PL PREFIX=$(PREFIX) INSTALLDIRS=vendor
1487++ cd perl && perl Makefile.PL PREFIX=$(PREFIX) INSTALLDIRS=vendor
1488+ cd perl && $(MAKE)
1489+
1490+ install: all
1491+diff --git a/ex/needrestart.conf b/ex/needrestart.conf
1492+index cfe2b09..1710b4c 100644
1493+--- a/ex/needrestart.conf
1494++++ b/ex/needrestart.conf
1495+@@ -1,4 +1,3 @@
1496+-
1497+ # needrestart - Restart daemons after library updates.
1498+ #
1499+ # This is the configuration file of needrestart. This is perl syntax.
1500+diff --git a/needrestart b/needrestart
1501+index 1524543..43e530d 100755
1502+--- a/needrestart
1503++++ b/needrestart
1504+@@ -449,20 +449,20 @@ if(defined($opt_l)) {
1505+ sub findppid($@) {
1506+ my $uid = shift;
1507+ my ($pid, @pids) = @_;
1508+-
1509++
1510+ if($ptable->{$pid}->{ppid} == 1) {
1511+ return $pid
1512+ if($ptable->{$pid}->{uid} == $uid);
1513+-
1514++
1515+ return undef;
1516+ }
1517+-
1518++
1519+ foreach my $pid (@pids) {
1520+ my $ppid = &findppid($uid, $pid);
1521+-
1522++
1523+ return $ppid if($ppid);
1524+ }
1525+-
1526++
1527+ return $pid;
1528+ }
1529+
1530+@@ -978,7 +978,7 @@ if(defined($opt_l) && !$uid) {
1531+ $nagios{sstr} .= " (!!)";
1532+ }
1533+ }
1534+-
1535++
1536+ foreach my $rc (sort { lc($a) cmp lc($b) } keys %restart) {
1537+ # always combine restarts in one systemctl command
1538+ local $nrconf{systemctl_combine} = 1 unless($opt_r eq 'l');
1539+@@ -1278,7 +1278,7 @@ if($opt_p) {
1540+ 2 => q(CRIT),
1541+ 3 => q(UNKN),
1542+ );
1543+- my ($ret) = reverse sort
1544++ my ($ret) = reverse sort
1545+ (($opt_k ? $nagios{kret} : ()), ($opt_w ? $nagios{mret} : ()),
1546+ ($opt_l ? ($nagios{sret}, $nagios{cret}, $nagios{uret}) : ()));
1547+
1548+diff --git a/perl/lib/NeedRestart.pm b/perl/lib/NeedRestart.pm
1549+index 07eec9c..595d69b 100644
1550+--- a/perl/lib/NeedRestart.pm
1551++++ b/perl/lib/NeedRestart.pm
1552+@@ -258,7 +258,7 @@ sub needrestart_cont_get($) {
1553+ $n =~ s/^NeedRestart::CONT:://;
1554+
1555+ my %c = $cont->get;
1556+-
1557++
1558+ map {
1559+ ("$n $_" => $c{$_});
1560+ } sort keys %c;
1561+diff --git a/perl/lib/NeedRestart/Interp/Python.pm b/perl/lib/NeedRestart/Interp/Python.pm
1562+index 12c5dd2..559666c 100644
1563+--- a/perl/lib/NeedRestart/Interp/Python.pm
1564++++ b/perl/lib/NeedRestart/Interp/Python.pm
1565+@@ -198,14 +198,14 @@ sub files {
1566+ elsif(exists($ENV{PYTHONPATH})) {
1567+ delete($ENV{PYTHONPATH});
1568+ }
1569+-
1570++
1571+ # get include path
1572+ my ($pyread, $pywrite) = nr_fork_pipe2($self->{debug}, $ptable->{exec}, '-');
1573+ print $pywrite "import sys\nprint(sys.path)\n";
1574+ close($pywrite);
1575+ my ($path) = <$pyread>;
1576+ close($pyread);
1577+-
1578++
1579+ # look for module source files
1580+ my @path;
1581+ if(defined($path)) {
1582+@@ -217,7 +217,7 @@ sub files {
1583+ else {
1584+ print STDERR "$LOGPREF #$pid: failed to retrieve include path\n" if($self->{debug});
1585+ }
1586+-
1587++
1588+ my %files;
1589+ _scan($self->{debug}, $pid, $src, \%files, \@path);
1590+
1591+diff --git a/perl/lib/NeedRestart/Interp/Ruby.pm b/perl/lib/NeedRestart/Interp/Ruby.pm
1592+index 88d39c6..d02973d 100644
1593+--- a/perl/lib/NeedRestart/Interp/Ruby.pm
1594++++ b/perl/lib/NeedRestart/Interp/Ruby.pm
1595+@@ -195,7 +195,7 @@ sub files {
1596+ elsif(exists($ENV{RUBYLIB})) {
1597+ delete($ENV{RUBYLIB});
1598+ }
1599+-
1600++
1601+ # get include path
1602+ my $rbread = nr_fork_pipe($self->{debug}, $ptable->{exec}, '-e', 'puts $:');
1603+ my @path = map { "/proc/$pid/root/$_"; } <$rbread>;
1604+diff --git a/perl/lib/NeedRestart/Kernel.pm b/perl/lib/NeedRestart/Kernel.pm
1605+index 221e8a2..ad8215b 100644
1606+--- a/perl/lib/NeedRestart/Kernel.pm
1607++++ b/perl/lib/NeedRestart/Kernel.pm
1608+@@ -143,7 +143,7 @@ sub nr_kernel_vcmp($$) {
1609+ # compare kernel version strings according to RPM version sorting
1610+ # adopted from RPM::VersionSort
1611+ sub nr_kernel_vcmp_rpm {
1612+- # split version strings by non-alphanumeric digits
1613++ # split version strings by non-alphanumeric digits
1614+ my @a = split(/[^a-z\d]+/i, shift);
1615+ my @b = split(/[^a-z\d]+/i, shift);
1616+
1617+--
1618+2.35.1
1619+
1620diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0028-Update-README.batch.md.patch b/debian/patches/Jammy-update-to-git-eb3531af-0028-Update-README.batch.md.patch
1621new file mode 100644
1622index 0000000..1c22feb
1623--- /dev/null
1624+++ b/debian/patches/Jammy-update-to-git-eb3531af-0028-Update-README.batch.md.patch
1625@@ -0,0 +1,30 @@
1626+Description: backport from git to stabilize jammy
1627+Origin: upstream, d33b0c20cdc2999890acb07aa248378d0d175895
1628+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
1629+Last-Update: 2022-03-16
1630+From d33b0c20cdc2999890acb07aa248378d0d175895 Mon Sep 17 00:00:00 2001
1631+From: Stavros Ntentos <133706+stdedos@users.noreply.github.com>
1632+Date: Tue, 28 Sep 2021 11:32:50 +0300
1633+Subject: [PATCH 28/43] Update README.batch.md
1634+
1635+Did you mean: compliant
1636+---
1637+ README.batch.md | 2 +-
1638+ 1 file changed, 1 insertion(+), 1 deletion(-)
1639+
1640+diff --git a/README.batch.md b/README.batch.md
1641+index 88fcd4e..55c429e 100644
1642+--- a/README.batch.md
1643++++ b/README.batch.md
1644+@@ -16,7 +16,7 @@ NEEDRESTART-CONT: LXC web1
1645+
1646+ Batch mode can be used to use the results of needrestart in other scripts.
1647+ While needrestart is run in batch mode it will never show any UI dialogs
1648+-nor restart anything. The output format is complaint to the
1649++nor restart anything. The output format is compliant to the
1650+ *apt-dater protocol*[1].
1651+
1652+ [1] https://github.com/DE-IBH/apt-dater-host/blob/master/doc/
1653+--
1654+2.35.1
1655+
1656diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0029-Ignore-all-memfd-mappings-Debian-Bug-972685-by-Micha.patch b/debian/patches/Jammy-update-to-git-eb3531af-0029-Ignore-all-memfd-mappings-Debian-Bug-972685-by-Micha.patch
1657new file mode 100644
1658index 0000000..d90fc79
1659--- /dev/null
1660+++ b/debian/patches/Jammy-update-to-git-eb3531af-0029-Ignore-all-memfd-mappings-Debian-Bug-972685-by-Micha.patch
1661@@ -0,0 +1,46 @@
1662+Description: backport from git to stabilize jammy
1663+Origin: upstream, 6c87772bdc38091e9efbf4c59217fa502365dcf2
1664+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
1665+Last-Update: 2022-03-16
1666+From 6c87772bdc38091e9efbf4c59217fa502365dcf2 Mon Sep 17 00:00:00 2001
1667+From: Thomas Liske <thomas@fiasko-nw.net>
1668+Date: Sun, 10 Oct 2021 22:35:04 +0200
1669+Subject: [PATCH 29/43] Ignore all memfd mappings (Debian Bug#972685 by Michail
1670+ Bachmann <m.bachmann@cms.hu-berlin.de>).
1671+
1672+---
1673+ ChangeLog | 2 ++
1674+ ex/needrestart.conf | 4 ++--
1675+ 2 files changed, 4 insertions(+), 2 deletions(-)
1676+
1677+diff --git a/ChangeLog b/ChangeLog
1678+index cb1dbef..7618b0d 100644
1679+--- a/ChangeLog
1680++++ b/ChangeLog
1681+@@ -28,6 +28,8 @@ needrestart 3.6
1682+ (github pull request #197 by Jan-Philipp Litza @jplitza)
1683+ - [Core] Ignore memfd files like used by nvidia's binary drivers.
1684+ (github pull request #200 by Jan Visser @starquake)
1685++ - [Core] Ignore all memfd mappings.
1686++ (Debian Bug#972685 by Michail Bachmann <m.bachmann@cms.hu-berlin.de>)
1687+ - [Core] Ignore Java Native Access mappings.
1688+ (github issue #142 by @nirgal)
1689+ (github issue #185 by Ivan Zaera @izaera)
1690+diff --git a/ex/needrestart.conf b/ex/needrestart.conf
1691+index 1710b4c..d7fe3e9 100644
1692+--- a/ex/needrestart.conf
1693++++ b/ex/needrestart.conf
1694+@@ -151,8 +151,8 @@ $nrconf{blacklist_mappings} = [
1695+ # special device paths
1696+ qr(^/(SYSV00000000( \(deleted\))?|drm(\s|$)|dev/)),
1697+
1698+- # ignore memfd file used by nvidia binary drivers
1699+- qr(^/memfd:/.glXXXXXX),
1700++ # ignore memfd mappings
1701++ qr(^/memfd:),
1702+
1703+ # aio(7) mapping
1704+ qr(^/\[aio\]),
1705+--
1706+2.35.1
1707+
1708diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0030-Kernel-Replace-strings-1-by-GNU-grep-to-drop-binutil.patch b/debian/patches/Jammy-update-to-git-eb3531af-0030-Kernel-Replace-strings-1-by-GNU-grep-to-drop-binutil.patch
1709new file mode 100644
1710index 0000000..240f952
1711--- /dev/null
1712+++ b/debian/patches/Jammy-update-to-git-eb3531af-0030-Kernel-Replace-strings-1-by-GNU-grep-to-drop-binutil.patch
1713@@ -0,0 +1,45 @@
1714+Description: backport from git to stabilize jammy
1715+Origin: upstream, e6176258e6b9f9f907736cbe1f8d148582a057d9
1716+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
1717+Last-Update: 2022-03-16
1718+From e6176258e6b9f9f907736cbe1f8d148582a057d9 Mon Sep 17 00:00:00 2001
1719+From: Thomas Liske <thomas@fiasko-nw.net>
1720+Date: Sun, 10 Oct 2021 23:10:37 +0200
1721+Subject: [PATCH 30/43] [Kernel] Replace strings(1) by GNU grep to drop
1722+ binutils dependency (Debian Bug#986507 by Trent W. Buck
1723+ <trentbuck@gmail.com>).
1724+
1725+---
1726+ ChangeLog | 2 ++
1727+ lib/vmlinuz-get-version | 2 +-
1728+ 2 files changed, 3 insertions(+), 1 deletion(-)
1729+
1730+diff --git a/ChangeLog b/ChangeLog
1731+index 7618b0d..73bd109 100644
1732+--- a/ChangeLog
1733++++ b/ChangeLog
1734+@@ -15,6 +15,8 @@ needrestart 3.6
1735+ (github pull request #209 by Erik Tews @eriktews)
1736+ - [Core] Do not restart elogind by default.
1737+ (github issue #205 by @HumanG33k)
1738++ - [Kernel] Replace strings(1) by GNU grep to drop binutils dependency.
1739++ (Debian Bug#986507 by Trent W. Buck <trentbuck@gmail.com>)
1740+
1741+ * Fixes:
1742+ - [Core] Fix comment for default value of `skip_mapfiles`.
1743+diff --git a/lib/vmlinuz-get-version b/lib/vmlinuz-get-version
1744+index ec94fe7..8f650b5 100755
1745+--- a/lib/vmlinuz-get-version
1746++++ b/lib/vmlinuz-get-version
1747+@@ -20,7 +20,7 @@
1748+ get_version()
1749+ {
1750+ # search and output version string pattern
1751+- strings "$1" | grep -m 1 '^Linux version ' && exit 0
1752++ grep -aom 1 'Linux version [0123456789].*' "$1" && exit 0
1753+ }
1754+
1755+ try_decompress()
1756+--
1757+2.35.1
1758+
1759diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0031-Do-not-print-perfdata-if-unknown-state.patch b/debian/patches/Jammy-update-to-git-eb3531af-0031-Do-not-print-perfdata-if-unknown-state.patch
1760new file mode 100644
1761index 0000000..eb61cad
1762--- /dev/null
1763+++ b/debian/patches/Jammy-update-to-git-eb3531af-0031-Do-not-print-perfdata-if-unknown-state.patch
1764@@ -0,0 +1,41 @@
1765+Description: backport from git to stabilize jammy
1766+Origin: upstream, 23d29f8b66d067bcdaa425a127bf184865e3eb53
1767+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
1768+Last-Update: 2022-03-16
1769+From 23d29f8b66d067bcdaa425a127bf184865e3eb53 Mon Sep 17 00:00:00 2001
1770+From: rincewind <rincewind@example.com>
1771+Date: Sat, 23 Oct 2021 12:41:57 +0200
1772+Subject: [PATCH 31/43] Do not print perfdata if unknown state
1773+
1774+When using the nagios plugin mode, the performance data were printed
1775+in an invalid format if the result of one subcheck returned UNKNOWN.
1776+This fixes this and will only print the performance data, if the state
1777+of the subcheck is really known.
1778+---
1779+ needrestart | 10 +++++-----
1780+ 1 file changed, 5 insertions(+), 5 deletions(-)
1781+
1782+diff --git a/needrestart b/needrestart
1783+index 43e530d..f4eff15 100755
1784+--- a/needrestart
1785++++ b/needrestart
1786+@@ -1289,11 +1289,11 @@ if($opt_p) {
1787+ ($opt_l ? "Containers: $nagios{cstr}" : ()),
1788+ ($opt_l ? "Sessions: $nagios{ustr}" : ()),
1789+ ), '|', join(' ',
1790+- ($opt_k ? "Kernel=$nagios{kperf};0;;0;2" : ()),
1791+- ($opt_w ? "Microcode=$nagios{mperf};0;;0;1" : ()),
1792+- ($opt_l ? "Services=$nagios{sperf};;0;0" : ()),
1793+- ($opt_l ? "Containers=$nagios{cperf};;0;0" : ()),
1794+- ($opt_l ? "Sessions=$nagios{uperf};0;;0" : ()),
1795++ ( ($opt_k && $nagios{kret} != 3) ? "Kernel=$nagios{kperf};0;;0;2" : ()),
1796++ ( ($opt_w && $nagios{mret} != 3) ? "Microcode=$nagios{mperf};0;;0;1" : ()),
1797++ ( ($opt_l && $nagios{sret} != 3) ? "Services=$nagios{sperf};;0;0" : ()),
1798++ ( ($opt_l && $nagios{cret} != 3) ? "Containers=$nagios{cperf};;0;0" : ()),
1799++ ( ($opt_l && $nagios{uret} != 3) ? "Sessions=$nagios{uperf};0;;0" : ()),
1800+ ), "\n";
1801+
1802+ if(scalar %restart) {
1803+--
1804+2.35.1
1805+
1806diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0032-Add-icinga2-example-config.patch b/debian/patches/Jammy-update-to-git-eb3531af-0032-Add-icinga2-example-config.patch
1807new file mode 100644
1808index 0000000..287c697
1809--- /dev/null
1810+++ b/debian/patches/Jammy-update-to-git-eb3531af-0032-Add-icinga2-example-config.patch
1811@@ -0,0 +1,58 @@
1812+Description: backport from git to stabilize jammy
1813+Origin: upstream, 84e56f12095aa2a16ae5f31808702e23950ae7eb
1814+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
1815+Last-Update: 2022-03-16
1816+From 84e56f12095aa2a16ae5f31808702e23950ae7eb Mon Sep 17 00:00:00 2001
1817+From: rincewind <rincewind@example.com>
1818+Date: Sat, 23 Oct 2021 15:38:35 +0200
1819+Subject: [PATCH 32/43] Add icinga2 example config
1820+
1821+---
1822+ ex/icinga2/command.conf | 17 +++++++++++++++++
1823+ ex/icinga2/needrestart-sudoers | 10 ++++++++++
1824+ 2 files changed, 27 insertions(+)
1825+ create mode 100644 ex/icinga2/command.conf
1826+ create mode 100644 ex/icinga2/needrestart-sudoers
1827+
1828+diff --git a/ex/icinga2/command.conf b/ex/icinga2/command.conf
1829+new file mode 100644
1830+index 0000000..d410b80
1831+--- /dev/null
1832++++ b/ex/icinga2/command.conf
1833+@@ -0,0 +1,17 @@
1834++object CheckCommand "needrestart" {
1835++ command = [ "/usr/sbin/needrestart", "-p" ]
1836++ arguments = {
1837++ "-k" = {
1838++ description = "check for obsolete kernel"
1839++ set_if = "$needrestart_kernel$"
1840++ }
1841++ "-l" = {
1842++ description = "check for obsolete libraries"
1843++ set_if = "$needrestart_libraries$"
1844++ }
1845++ "-w" = {
1846++ description = "check for obsolete CPU microcode"
1847++ set_if = "$needrestart_microcode$"
1848++ }
1849++ }
1850++}
1851+diff --git a/ex/icinga2/needrestart-sudoers b/ex/icinga2/needrestart-sudoers
1852+new file mode 100644
1853+index 0000000..ef55834
1854+--- /dev/null
1855++++ b/ex/icinga2/needrestart-sudoers
1856+@@ -0,0 +1,10 @@
1857++# needrestart nagios plugin sudoers.d config file
1858++# -----------------------------------------------
1859++#
1860++# Please consider a look at /etc/sudoers.d/README howto enable this file.
1861++#
1862++
1863++# Allow nagios to execute the needrestart command on debian based systems (icinga user is called "nagios")
1864++nagios ALL=NOPASSWD: /usr/sbin/needrestart
1865++# Allow nagios to execute the needrestart command on centos and family (icinga user is called "icinga")
1866++icinga ALL=NOPASSWD: /usr/sbin/needrestart
1867+--
1868+2.35.1
1869+
1870diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0033-also-output-user-sessions-in-batch-mode.patch b/debian/patches/Jammy-update-to-git-eb3531af-0033-also-output-user-sessions-in-batch-mode.patch
1871new file mode 100644
1872index 0000000..5676eaa
1873--- /dev/null
1874+++ b/debian/patches/Jammy-update-to-git-eb3531af-0033-also-output-user-sessions-in-batch-mode.patch
1875@@ -0,0 +1,100 @@
1876+Description: backport from git to stabilize jammy
1877+Origin: upstream, 1ff1bf40eac4bdf56862fcdbd261829e18eb5873
1878+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
1879+Last-Update: 2022-03-16
1880+From 1ff1bf40eac4bdf56862fcdbd261829e18eb5873 Mon Sep 17 00:00:00 2001
1881+From: =?UTF-8?q?Antoine=20Beaupr=C3=A9?= <anarcat@debian.org>
1882+Date: Tue, 25 Jan 2022 21:38:57 -0500
1883+Subject: [PATCH 33/43] also output user sessions in batch mode
1884+
1885+The user sessions present in the normal and nagios output is
1886+mysteriously missing from the batch output. This remedies that
1887+limitation by reusing the user-readable output from the Nagios output.
1888+
1889+We also update the README.batch documentation, but that's still
1890+lacking a little, see #230.
1891+
1892+Closes: #231
1893+---
1894+ README.batch.md | 2 ++
1895+ needrestart | 43 ++++++++++++++++++++++++++++---------------
1896+ 2 files changed, 30 insertions(+), 15 deletions(-)
1897+
1898+diff --git a/README.batch.md b/README.batch.md
1899+index 88fcd4e..cc7ef2c 100644
1900+--- a/README.batch.md
1901++++ b/README.batch.md
1902+@@ -12,6 +12,8 @@ NEEDRESTART-KSTA: 1
1903+ NEEDRESTART-SVC: systemd-journald.service
1904+ NEEDRESTART-SVC: systemd-machined.service
1905+ NEEDRESTART-CONT: LXC web1
1906++NEEDRESTART-SESS: metabase @ user manager service
1907++NEEDRESTART-SESS: root @ session #28017
1908+ ```
1909+
1910+ Batch mode can be used to use the results of needrestart in other scripts.
1911+diff --git a/needrestart b/needrestart
1912+index 43e530d..7af9843 100755
1913+--- a/needrestart
1914++++ b/needrestart
1915+@@ -1270,6 +1270,27 @@ if(scalar @easy_hints) {
1916+ $ui->announce_ehint(EHINT => ($h ? join(' ', $h, __ 'and', '') : '') . $t);
1917+ }
1918+
1919++my @sessions_list;
1920++if(scalar %sessions) {
1921++ # build a sorted list of user @ session strings
1922++ #
1923++ # used in the nagios and batch outputs below
1924++ @sessions_list = map {
1925++ my $uid = $_;
1926++ my $user = uid2name($uid);
1927++ my @ret;
1928++
1929++ foreach my $sess (sort keys %{ $sessions{$uid} }) {
1930++ push(@ret, "$user \@ $sess");
1931++ }
1932++
1933++ @ret;
1934++ }
1935++ sort {
1936++ ncmp(uid2name($a), uid2name($b));
1937++ } keys %sessions
1938++}
1939++
1940+ # nagios plugin output
1941+ if($opt_p) {
1942+ my %states = (
1943+@@ -1306,22 +1327,14 @@ if($opt_p) {
1944+ }
1945+
1946+ if(scalar %sessions) {
1947+- print "Sessions:", join("\n- ", '',
1948+- map {
1949+- my $uid = $_;
1950+- my $user = uid2name($uid);
1951+- my @ret;
1952+-
1953+- foreach my $sess (sort keys %{ $sessions{$uid} }) {
1954+- push(@ret, "$user \@ $sess");
1955+- }
1956+-
1957+- @ret;
1958+- }
1959+- sort {
1960+- ncmp(uid2name($a), uid2name($b));
1961+- } keys %sessions), "\n";
1962++ print "Sessions:", join("\n- ", '', @sessions_list), "\n";
1963+ }
1964+
1965+ exit $ret;
1966+ }
1967++
1968++if ($opt_b and scalar %sessions) {
1969++ for my $sess (@sessions_list) {
1970++ print "NEEDRESTART-SESS: $sess\n";
1971++ }
1972++}
1973+--
1974+2.35.1
1975+
1976diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0034-Update-README.batch.md.patch b/debian/patches/Jammy-update-to-git-eb3531af-0034-Update-README.batch.md.patch
1977new file mode 100644
1978index 0000000..5722a10
1979--- /dev/null
1980+++ b/debian/patches/Jammy-update-to-git-eb3531af-0034-Update-README.batch.md.patch
1981@@ -0,0 +1,32 @@
1982+Description: backport from git to stabilize jammy
1983+Origin: upstream, e9fb6c990e887349f9c733e174845e0424e3b219
1984+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
1985+Last-Update: 2022-03-16
1986+From e9fb6c990e887349f9c733e174845e0424e3b219 Mon Sep 17 00:00:00 2001
1987+From: Stavros Ntentos <133706+stdedos@users.noreply.github.com>
1988+Date: Wed, 26 Jan 2022 07:43:49 +0200
1989+Subject: [PATCH 34/43] Update README.batch.md
1990+
1991+_Commit suggestion from @anarcat_
1992+
1993+Co-authored-by: anarcat <anarcat@users.noreply.github.com>
1994+---
1995+ README.batch.md | 2 +-
1996+ 1 file changed, 1 insertion(+), 1 deletion(-)
1997+
1998+diff --git a/README.batch.md b/README.batch.md
1999+index 55c429e..cdbd2c2 100644
2000+--- a/README.batch.md
2001++++ b/README.batch.md
2002+@@ -16,7 +16,7 @@ NEEDRESTART-CONT: LXC web1
2003+
2004+ Batch mode can be used to use the results of needrestart in other scripts.
2005+ While needrestart is run in batch mode it will never show any UI dialogs
2006+-nor restart anything. The output format is compliant to the
2007++nor restart anything. The output format is compliant with the
2008+ *apt-dater protocol*[1].
2009+
2010+ [1] https://github.com/DE-IBH/apt-dater-host/blob/master/doc/
2011+--
2012+2.35.1
2013+
2014diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0035-use-a-configurable-tolerance-when-checking-interpret.patch b/debian/patches/Jammy-update-to-git-eb3531af-0035-use-a-configurable-tolerance-when-checking-interpret.patch
2015new file mode 100644
2016index 0000000..390b1f2
2017--- /dev/null
2018+++ b/debian/patches/Jammy-update-to-git-eb3531af-0035-use-a-configurable-tolerance-when-checking-interpret.patch
2019@@ -0,0 +1,127 @@
2020+Description: backport from git to stabilize jammy
2021+Origin: upstream, 2c74dc034f3e5c177c255642c230d0eab4230395
2022+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
2023+Last-Update: 2022-03-16
2024+From 2c74dc034f3e5c177c255642c230d0eab4230395 Mon Sep 17 00:00:00 2001
2025+From: Corey Hickey <chickey@tagged.com>
2026+Date: Thu, 27 Jan 2022 14:55:43 -0800
2027+Subject: [PATCH 35/43] use a configurable tolerance when checking interpreter
2028+ files
2029+
2030+This addresses:
2031+https://github.com/liske/needrestart/issues/228
2032+...without being a complete "fix", since that does not seem to be
2033+possible.
2034+
2035+Further details are in the bug report above, but in brief, Linux can
2036+only report process start time with a precision of 1.1 seconds, and that
2037+gets rounded off, thus false positives are quite possible for processes
2038+that start immediately after their files are created.
2039+
2040+Since this can allow some false negatives, allow the user to decide.
2041+The default tolerance of 2 should accomodate common use cases without
2042+causing excessive false negatives.
2043+---
2044+ man/needrestart.1 | 3 +++
2045+ needrestart | 10 +++++++---
2046+ perl/lib/NeedRestart.pm | 5 +++--
2047+ 3 files changed, 13 insertions(+), 5 deletions(-)
2048+
2049+diff --git a/man/needrestart.1 b/man/needrestart.1
2050+index 75042bf..39627dd 100644
2051+--- a/man/needrestart.1
2052++++ b/man/needrestart.1
2053+@@ -52,6 +52,9 @@ nagios plugin mode: makes output and exit codes nagios compatible
2054+ \fB\-f\fR <fe>
2055+ override debconf(7) frontend, sets the DEBIAN_FRONTEND environment variable to <fe>
2056+ .TP
2057++\fB\-t\fR <seconds>
2058++When checking running interpreter processes, allow process start times that are close to timestamps of files the interpreter uses, within this tolerance (default 2). The default value of 2 seconds is best for checks of Linux hosts, on which system limitations prevent more accurate measurements of process start times. Values higher than 0 should prevent false positives yet may in extreme cases cause false negatives; values higher than 2 should not be necessary.
2059++.TP
2060+ \fB\-u\fR <ui>
2061+ use preferred UI package (-u ? shows available packages)
2062+ .PP
2063+diff --git a/needrestart b/needrestart
2064+index 0a048b5..91c467e 100755
2065+--- a/needrestart
2066++++ b/needrestart
2067+@@ -92,6 +92,7 @@ Usage:
2068+ -b enable batch mode
2069+ -p enable nagios plugin mode
2070+ -f <fe> override debconf frontend (DEBIAN_FRONTEND, debconf(7))
2071++ -t <seconds> tolerate interpreter process start times within this value
2072+ -u <ui> use preferred UI package (-u ? shows available packages)
2073+
2074+ By using the following options only the specified checks are performed:
2075+@@ -157,6 +158,7 @@ our %nrconf = (
2076+ containers => 1,
2077+ },
2078+ has_pam_systemd => 1,
2079++ tolerance => 2,
2080+ );
2081+
2082+ # backup ARGV (required for Debconf)
2083+@@ -173,9 +175,10 @@ our $opt_k;
2084+ our $opt_l;
2085+ our $opt_p;
2086+ our $opt_q;
2087++our $opt_t;
2088+ our $opt_u;
2089+ our $opt_w;
2090+-unless(getopts('c:vr:nm:bf:klpqu:w')) {
2091++unless(getopts('c:vr:nm:bf:klpqt:u:w')) {
2092+ HELP_MESSAGE;
2093+ exit 1;
2094+ }
2095+@@ -224,6 +227,7 @@ $opt_r = 'l' if(!$is_tty && $opt_r eq 'i');
2096+ $opt_m = $nrconf{ui_mode} unless(defined($opt_m));
2097+ die "ERROR: Unknown UI mode '$opt_m'!\n" unless($opt_m =~ /^(e|a)$/);
2098+ $opt_r = 'l' if($opt_m eq 'e');
2099++$opt_t = $nrconf{tolerance} unless(defined($opt_t));
2100+
2101+ $nrconf{defno}++ if($opt_n);
2102+ $opt_b++ if($opt_p);
2103+@@ -564,11 +568,11 @@ if(defined($opt_l)) {
2104+ }
2105+
2106+ unless($restart || !$nrconf{interpscan}) {
2107+- $restart++ if(needrestart_interp_check($nrconf{verbosity} > 1, $pid, $exe, $nrconf{blacklist_interp}));
2108++ $restart++ if(needrestart_interp_check($nrconf{verbosity} > 1, $pid, $exe, $nrconf{blacklist_interp}, $opt_t));
2109+ }
2110+
2111+ # handle containers (LXC, docker, etc.)
2112+- next if($restart && needrestart_cont_check($nrconf{verbosity} > 1, $pid, $exe));
2113++ next if($restart && needrestart_cont_check($nrconf{verbosity} > 1, $pid, $exe, $opt_t));
2114+
2115+ # restart needed?
2116+ next unless($restart);
2117+diff --git a/perl/lib/NeedRestart.pm b/perl/lib/NeedRestart.pm
2118+index 595d69b..99afc5d 100644
2119+--- a/perl/lib/NeedRestart.pm
2120++++ b/perl/lib/NeedRestart.pm
2121+@@ -155,11 +155,12 @@ sub needrestart_interp_init($) {
2122+ }
2123+ }
2124+
2125+-sub needrestart_interp_check($$$$) {
2126++sub needrestart_interp_check($$$$$) {
2127+ my $debug = shift;
2128+ my $pid = shift;
2129+ my $bin = shift;
2130+ my $blacklist = shift;
2131++ my $tolerance = shift;
2132+
2133+ needrestart_interp_init($debug) unless(%Interps);
2134+
2135+@@ -176,7 +177,7 @@ sub needrestart_interp_check($$$$) {
2136+ delete($files{$path});
2137+ }
2138+
2139+- if(grep {!defined($_) || $_ > $ps->start} values %files) {
2140++ if(grep {!defined($_) || $_ > $ps->start + $tolerance} values %files) {
2141+ if($debug) {
2142+ print STDERR "$LOGPREF #$pid uses obsolete script file(s):";
2143+ print STDERR join("\n$LOGPREF #$pid ", '', map {(!defined($files{$_}) || $files{$_} > $ps->start ? $_ : ())} keys %files);
2144+--
2145+2.35.1
2146+
2147diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0036-Fix-docker-detection-on-newer-Kernels.patch b/debian/patches/Jammy-update-to-git-eb3531af-0036-Fix-docker-detection-on-newer-Kernels.patch
2148new file mode 100644
2149index 0000000..cad1045
2150--- /dev/null
2151+++ b/debian/patches/Jammy-update-to-git-eb3531af-0036-Fix-docker-detection-on-newer-Kernels.patch
2152@@ -0,0 +1,38 @@
2153+Description: backport from git to stabilize jammy
2154+Origin: upstream, c250c9042900d5ea12fdeaac0a05a78d6fc08b73
2155+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
2156+Last-Update: 2022-03-16
2157+From c250c9042900d5ea12fdeaac0a05a78d6fc08b73 Mon Sep 17 00:00:00 2001
2158+From: Markus Frosch <markus@lazyfrosch.de>
2159+Date: Fri, 11 Feb 2022 17:49:32 +0100
2160+Subject: [PATCH 36/43] Fix docker detection on newer Kernels
2161+
2162+On Debian bullseye there will not always be a string after the first colon.
2163+
2164+Example:
2165+
2166+ 0::/system.slice/docker-xxx.scope
2167+---
2168+ perl/lib/NeedRestart/CONT/docker.pm | 6 +++---
2169+ 1 file changed, 3 insertions(+), 3 deletions(-)
2170+
2171+diff --git a/perl/lib/NeedRestart/CONT/docker.pm b/perl/lib/NeedRestart/CONT/docker.pm
2172+index 80fdfc4..4a22525 100644
2173+--- a/perl/lib/NeedRestart/CONT/docker.pm
2174++++ b/perl/lib/NeedRestart/CONT/docker.pm
2175+@@ -67,9 +67,9 @@ sub check {
2176+ }
2177+
2178+ # look for docker cgroups
2179+- return 0 unless($cg =~ /^\d+:[^:]+:\/system.slice\/docker-(.+)\.scope$/m ||
2180+- $cg =~ /^\d+:[^:]+:\/system.slice\/docker\.service$/m ||
2181+- $cg =~ /^\d+:[^:]+:\/docker\/([\da-f]+)$/m);
2182++ return 0 unless($cg =~ /^\d+:[^:]*:\/system.slice\/docker-(.+)\.scope$/m ||
2183++ $cg =~ /^\d+:[^:]*:\/system.slice\/docker\.service$/m ||
2184++ $cg =~ /^\d+:[^:]*:\/docker\/([\da-f]+)$/m);
2185+
2186+ print STDERR "$LOGPREF #$pid is part of docker container '$1' and will be ignored\n" if($self->{debug});
2187+
2188+--
2189+2.35.1
2190+
2191diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0037-Default-override-virtlogd-virtlockd.patch b/debian/patches/Jammy-update-to-git-eb3531af-0037-Default-override-virtlogd-virtlockd.patch
2192new file mode 100644
2193index 0000000..88872b4
2194--- /dev/null
2195+++ b/debian/patches/Jammy-update-to-git-eb3531af-0037-Default-override-virtlogd-virtlockd.patch
2196@@ -0,0 +1,41 @@
2197+Description: backport from git to stabilize jammy
2198+Origin: upstream, 0284ddc1be44303f131142448663c5702a44bc09
2199+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
2200+Last-Update: 2022-03-16
2201+From 0284ddc1be44303f131142448663c5702a44bc09 Mon Sep 17 00:00:00 2001
2202+From: Christian Ehrhardt <christian.ehrhardt@canonical.com>
2203+Date: Fri, 9 Jul 2021 08:21:49 +0200
2204+Subject: [PATCH 37/43] Default override virtlogd / virtlockd
2205+
2206+Restarting virtlogd / virtlockd is really bad as guests would be fenced
2207+and restarted. This is intentionally skipped on the package upgrade [1]
2208+and tried to be the last that dies by upstream [2][3].
2209+
2210+We should at least not preselect those services to avoid these issues,
2211+therefore add them to the default override config.
2212+
2213+[1]: https://salsa.debian.org/libvirt-team/libvirt/-/blob/debian/master/debian/rules#L254
2214+[2]: https://libvirt.org/git/?p=libvirt.git;a=blob;f=src/logging/virtlogd.service.in;h=8ab547851772298ff570487f1ce2d3680c7e4d68;hb=HEAD#l13
2215+[3]: https://libvirt.org/git/?p=libvirt.git;a=blob;f=src/locking/virtlockd.service.in;h=4a6fab05ab309a04a8565a5c73cbcfb47dae8d5d;hb=HEAD#l13
2216+
2217+Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
2218+---
2219+ ex/needrestart.conf | 2 ++
2220+ 1 file changed, 2 insertions(+)
2221+
2222+diff --git a/ex/needrestart.conf b/ex/needrestart.conf
2223+index d7fe3e9..29d1e62 100644
2224+--- a/ex/needrestart.conf
2225++++ b/ex/needrestart.conf
2226+@@ -108,6 +108,8 @@ $nrconf{override_rc} = {
2227+ qr(^xendomains) => 0,
2228+ qr(^lxcfs) => 0,
2229+ qr(^libvirt) => 0,
2230++ qr(^virtlogd)} = 0,
2231++ qr(^virtlockd)} = 0,
2232+ qr(^docker) => 0,
2233+
2234+ # systemd stuff
2235+--
2236+2.35.1
2237+
2238diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0038-Detect-and-report-outdated-VMs.patch b/debian/patches/Jammy-update-to-git-eb3531af-0038-Detect-and-report-outdated-VMs.patch
2239new file mode 100644
2240index 0000000..f55667b
2241--- /dev/null
2242+++ b/debian/patches/Jammy-update-to-git-eb3531af-0038-Detect-and-report-outdated-VMs.patch
2243@@ -0,0 +1,106 @@
2244+Description: backport from git to stabilize jammy
2245+Origin: upstream, 19c05a0e9bf425b0349d491ed026812a3a4d7359
2246+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
2247+Last-Update: 2022-03-16
2248+From 19c05a0e9bf425b0349d491ed026812a3a4d7359 Mon Sep 17 00:00:00 2001
2249+From: Christian Ehrhardt <christian.ehrhardt@canonical.com>
2250+Date: Fri, 9 Jul 2021 08:38:08 +0200
2251+Subject: [PATCH 38/43] Detect and report outdated VMs
2252+
2253+Needrestart is awesome in detecting long running services or user
2254+sessions that are still running with old binaries. But there is
2255+another common kind of long-running process - VM Guests.
2256+
2257+Detecting the common qemu/KVM guests and reporting those to the
2258+user will help them to realize that also those guests should be
2259+considered to be restarted (or migrated onto an updated host)
2260+
2261+Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
2262+---
2263+ needrestart | 42 +++++++++++++++++++++++++++++++++++++++++-
2264+ 1 file changed, 41 insertions(+), 1 deletion(-)
2265+
2266+diff --git a/needrestart b/needrestart
2267+index 91c467e..d38515c 100755
2268+--- a/needrestart
2269++++ b/needrestart
2270+@@ -441,6 +441,7 @@ print "NEEDRESTART-VER: $NeedRestart::VERSION\n" if($opt_b && !$opt_p);
2271+
2272+ my %restart;
2273+ my %sessions;
2274++my @guests;
2275+ my @easy_hints;
2276+
2277+ if(defined($opt_l)) {
2278+@@ -617,7 +618,7 @@ if(defined($opt_l)) {
2279+
2280+ if(scalar keys %stage2 && !$uid) {
2281+ $ui->progress_prep(scalar keys %stage2, __ 'Scanning candidates...');
2282+- foreach my $pid (sort {$a <=> $b} keys %stage2) {
2283++ PIDLOOP: foreach my $pid (sort {$a <=> $b} keys %stage2) {
2284+ $ui->progress_step;
2285+
2286+ # skip myself
2287+@@ -660,6 +661,25 @@ if(defined($opt_l)) {
2288+ print STDERR "$LOGPREF #$pid part of user manager service: uid=$1\n" if($nrconf{verbosity} > 1);
2289+ push(@{ $sessions{$1}->{'user manager service'}->{ $ptable->{$pid}->{fname} } }, $pid);
2290+ next;
2291++ }
2292++ if($value =~ m@/machine.slice/machine.qemu(.*).scope@) {
2293++ for my $cmdlineidx (0 .. $#{$ptable->{$pid}->{cmdline}} ) {
2294++ if ( ${$ptable->{$pid}->{cmdline}}[$cmdlineidx] eq "-name") {
2295++ foreach ( split(/,/, ${$ptable->{$pid}->{cmdline}}[$cmdlineidx+1]) ) {
2296++ if ( index($_, "guest=") == 0 ) {
2297++ my @namearg = split(/=/, $_, 2);
2298++ if ($#{namearg} == 1) {
2299++ print STDERR "$LOGPREF #$pid detected as VM guest '$namearg[1]' in group '$value'\n" if($nrconf{verbosity} > 1);
2300++ push(@guests, "VM '$namearg[1]' with pid $pid" );
2301++ }
2302++ next PIDLOOP;
2303++ }
2304++ }
2305++ }
2306++ }
2307++ print STDERR "$LOGPREF #$pid detected as VM guest with unknown name in group '$value'\n" if($nrconf{verbosity} > 1);
2308++ push(@guests, "'Unkown VM' with pid $pid" );
2309++ next;
2310+ }
2311+ elsif($value =~ m@/([^/]+\.service)$@) {
2312+ ($1);
2313+@@ -761,6 +781,7 @@ if(defined($opt_l)) {
2314+ }
2315+
2316+ # No perfect hit - call any rc scripts instead.
2317++ print STDERR "$LOGPREF #$pid running $hook no perfect hit found $found pids $#nopids\n" if($nrconf{verbosity} > 1);
2318+ if(!$found && $#nopids > -1) {
2319+ foreach my $rc (@nopids) {
2320+ if($is_systemd && exists($restart{"$rc.service"})) {
2321+@@ -1265,6 +1286,25 @@ if(defined($opt_l) && !$uid) {
2322+ }
2323+ }
2324+ }
2325++
2326++ ## GUESTS
2327++ $ui->vspace();
2328++ if (! @guests) {
2329++ $ui->notice(__ 'No VM guests are running outdated binaries.') unless($opt_b || $opt_m eq 'e');
2330++ }
2331++ else {
2332++ if($opt_m eq 'e') {
2333++ push(@easy_hints, __ 'outdated VM guests');
2334++ }
2335++ else {
2336++ unless($opt_p || $opt_b) {
2337++ $ui->notice(__ 'VM guests running outdated binaries:');
2338++ foreach ( @guests ) {
2339++ $ui->notice(__ " $_");
2340++ }
2341++ }
2342++ }
2343++ }
2344+ }
2345+
2346+ # easy mode: print hint on outdated stuff
2347+--
2348+2.35.1
2349+
2350diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0039-VM-detection-improve-wording.patch b/debian/patches/Jammy-update-to-git-eb3531af-0039-VM-detection-improve-wording.patch
2351new file mode 100644
2352index 0000000..3e92871
2353--- /dev/null
2354+++ b/debian/patches/Jammy-update-to-git-eb3531af-0039-VM-detection-improve-wording.patch
2355@@ -0,0 +1,42 @@
2356+Description: backport from git to stabilize jammy
2357+Origin: upstream, 7bd0690e5707b1df4565c5d171273b57f716fda0
2358+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
2359+Last-Update: 2022-03-16
2360+From 7bd0690e5707b1df4565c5d171273b57f716fda0 Mon Sep 17 00:00:00 2001
2361+From: Christian Ehrhardt <christian.ehrhardt@canonical.com>
2362+Date: Thu, 3 Feb 2022 15:06:28 +0100
2363+Subject: [PATCH 39/43] VM detection: improve wording
2364+
2365+As discussed in the PR this shal avoid misunderstandings that we might
2366+scan inside the guest.
2367+
2368+Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
2369+---
2370+ needrestart | 4 ++--
2371+ 1 file changed, 2 insertions(+), 2 deletions(-)
2372+
2373+diff --git a/needrestart b/needrestart
2374+index d38515c..f664571 100755
2375+--- a/needrestart
2376++++ b/needrestart
2377+@@ -1290,7 +1290,7 @@ if(defined($opt_l) && !$uid) {
2378+ ## GUESTS
2379+ $ui->vspace();
2380+ if (! @guests) {
2381+- $ui->notice(__ 'No VM guests are running outdated binaries.') unless($opt_b || $opt_m eq 'e');
2382++ $ui->notice(__ 'No VM guests are running outdated hypervisor (qemu) binaries on this host.') unless($opt_b || $opt_m eq 'e');
2383+ }
2384+ else {
2385+ if($opt_m eq 'e') {
2386+@@ -1298,7 +1298,7 @@ if(defined($opt_l) && !$uid) {
2387+ }
2388+ else {
2389+ unless($opt_p || $opt_b) {
2390+- $ui->notice(__ 'VM guests running outdated binaries:');
2391++ $ui->notice(__ 'VM guests are running outdated hypervisor (qemu) binaries on this host:');
2392+ foreach ( @guests ) {
2393+ $ui->notice(__ " $_");
2394+ }
2395+--
2396+2.35.1
2397+
2398diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0040-VM-detection-fix-whitespace-damage.patch b/debian/patches/Jammy-update-to-git-eb3531af-0040-VM-detection-fix-whitespace-damage.patch
2399new file mode 100644
2400index 0000000..1147aa0
2401--- /dev/null
2402+++ b/debian/patches/Jammy-update-to-git-eb3531af-0040-VM-detection-fix-whitespace-damage.patch
2403@@ -0,0 +1,30 @@
2404+Description: backport from git to stabilize jammy
2405+Origin: upstream, a2395bad0e40ac4f52ddcfadc1a09276f78d0e0f
2406+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
2407+Last-Update: 2022-03-16
2408+From a2395bad0e40ac4f52ddcfadc1a09276f78d0e0f Mon Sep 17 00:00:00 2001
2409+From: Christian Ehrhardt <christian.ehrhardt@canonical.com>
2410+Date: Thu, 3 Feb 2022 15:07:53 +0100
2411+Subject: [PATCH 40/43] VM detection: fix whitespace damage
2412+
2413+Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
2414+---
2415+ needrestart | 2 +-
2416+ 1 file changed, 1 insertion(+), 1 deletion(-)
2417+
2418+diff --git a/needrestart b/needrestart
2419+index f664571..68db6c8 100755
2420+--- a/needrestart
2421++++ b/needrestart
2422+@@ -781,7 +781,7 @@ if(defined($opt_l)) {
2423+ }
2424+
2425+ # No perfect hit - call any rc scripts instead.
2426+- print STDERR "$LOGPREF #$pid running $hook no perfect hit found $found pids $#nopids\n" if($nrconf{verbosity} > 1);
2427++ print STDERR "$LOGPREF #$pid running $hook no perfect hit found $found pids $#nopids\n" if($nrconf{verbosity} > 1);
2428+ if(!$found && $#nopids > -1) {
2429+ foreach my $rc (@nopids) {
2430+ if($is_systemd && exists($restart{"$rc.service"})) {
2431+--
2432+2.35.1
2433+
2434diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0041-VM-detection-do-not-localize-guests-that-are-found.patch b/debian/patches/Jammy-update-to-git-eb3531af-0041-VM-detection-do-not-localize-guests-that-are-found.patch
2435new file mode 100644
2436index 0000000..67dd63d
2437--- /dev/null
2438+++ b/debian/patches/Jammy-update-to-git-eb3531af-0041-VM-detection-do-not-localize-guests-that-are-found.patch
2439@@ -0,0 +1,30 @@
2440+Description: backport from git to stabilize jammy
2441+Origin: upstream, c47a314a149a9fb1d3dacfce6fe914695ab1a0c2
2442+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
2443+Last-Update: 2022-03-16
2444+From c47a314a149a9fb1d3dacfce6fe914695ab1a0c2 Mon Sep 17 00:00:00 2001
2445+From: Christian Ehrhardt <christian.ehrhardt@canonical.com>
2446+Date: Tue, 15 Feb 2022 10:04:28 +0100
2447+Subject: [PATCH 41/43] VM detection: do not localize guests that are found
2448+
2449+Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
2450+---
2451+ needrestart | 2 +-
2452+ 1 file changed, 1 insertion(+), 1 deletion(-)
2453+
2454+diff --git a/needrestart b/needrestart
2455+index 68db6c8..fde3083 100755
2456+--- a/needrestart
2457++++ b/needrestart
2458+@@ -1300,7 +1300,7 @@ if(defined($opt_l) && !$uid) {
2459+ unless($opt_p || $opt_b) {
2460+ $ui->notice(__ 'VM guests are running outdated hypervisor (qemu) binaries on this host:');
2461+ foreach ( @guests ) {
2462+- $ui->notice(__ " $_");
2463++ $ui->notice(" $_");
2464+ }
2465+ }
2466+ }
2467+--
2468+2.35.1
2469+
2470diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0042-VM-detection-localize-normal-output-of-vm-detection.patch b/debian/patches/Jammy-update-to-git-eb3531af-0042-VM-detection-localize-normal-output-of-vm-detection.patch
2471new file mode 100644
2472index 0000000..256f166
2473--- /dev/null
2474+++ b/debian/patches/Jammy-update-to-git-eb3531af-0042-VM-detection-localize-normal-output-of-vm-detection.patch
2475@@ -0,0 +1,39 @@
2476+Description: backport from git to stabilize jammy
2477+Origin: upstream, babfc9d810cbd1df4b7397139d3c81130f51a49c
2478+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
2479+Last-Update: 2022-03-16
2480+From babfc9d810cbd1df4b7397139d3c81130f51a49c Mon Sep 17 00:00:00 2001
2481+From: Christian Ehrhardt <christian.ehrhardt@canonical.com>
2482+Date: Tue, 8 Mar 2022 09:24:33 +0100
2483+Subject: [PATCH 42/43] VM detection: localize normal output of vm detection
2484+
2485+Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
2486+---
2487+ needrestart | 4 ++--
2488+ 1 file changed, 2 insertions(+), 2 deletions(-)
2489+
2490+diff --git a/needrestart b/needrestart
2491+index fde3083..9f3d12b 100755
2492+--- a/needrestart
2493++++ b/needrestart
2494+@@ -670,7 +670,7 @@ if(defined($opt_l)) {
2495+ my @namearg = split(/=/, $_, 2);
2496+ if ($#{namearg} == 1) {
2497+ print STDERR "$LOGPREF #$pid detected as VM guest '$namearg[1]' in group '$value'\n" if($nrconf{verbosity} > 1);
2498+- push(@guests, "VM '$namearg[1]' with pid $pid" );
2499++ push(@guests, __x("'{name}' with pid {pid}", name => $namearg[1], pid=>$pid) );
2500+ }
2501+ next PIDLOOP;
2502+ }
2503+@@ -678,7 +678,7 @@ if(defined($opt_l)) {
2504+ }
2505+ }
2506+ print STDERR "$LOGPREF #$pid detected as VM guest with unknown name in group '$value'\n" if($nrconf{verbosity} > 1);
2507+- push(@guests, "'Unkown VM' with pid $pid" );
2508++ push(@guests, __x("'Unkown VM' with pid {pid}", pid=>$pid) );
2509+ next;
2510+ }
2511+ elsif($value =~ m@/([^/]+\.service)$@) {
2512+--
2513+2.35.1
2514+
2515diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0043-Fix-LXC-LXD-and-machined-detection-for-cgroups-v2.patch b/debian/patches/Jammy-update-to-git-eb3531af-0043-Fix-LXC-LXD-and-machined-detection-for-cgroups-v2.patch
2516new file mode 100644
2517index 0000000..a734e70
2518--- /dev/null
2519+++ b/debian/patches/Jammy-update-to-git-eb3531af-0043-Fix-LXC-LXD-and-machined-detection-for-cgroups-v2.patch
2520@@ -0,0 +1,48 @@
2521+Description: backport from git to stabilize jammy
2522+Origin: upstream, 8465c3eb9774ac2a07c8d1dd99a75c2bfdd10aa7
2523+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
2524+Last-Update: 2022-03-16
2525+From 8465c3eb9774ac2a07c8d1dd99a75c2bfdd10aa7 Mon Sep 17 00:00:00 2001
2526+From: Trent Lloyd <trent@lloyd.id.au>
2527+Date: Thu, 10 Mar 2022 15:11:42 +0800
2528+Subject: [PATCH 43/43] Fix LXC/LXD and machined detection for cgroups v2
2529+
2530+The second field is always blank in cgroups v2 unlike v1, adjust parsing to
2531+support both cases for LXC/LXD and machined. This is the same fix as previously
2532+made for Docker in #234.
2533+
2534+Example: 0::/lxc.payload.focal/system.slice/avahi-daemon.service
2535+---
2536+ perl/lib/NeedRestart/CONT/LXC.pm | 2 +-
2537+ perl/lib/NeedRestart/CONT/machined.pm | 2 +-
2538+ 2 files changed, 2 insertions(+), 2 deletions(-)
2539+
2540+diff --git a/perl/lib/NeedRestart/CONT/LXC.pm b/perl/lib/NeedRestart/CONT/LXC.pm
2541+index 3f522ae..4542f5b 100644
2542+--- a/perl/lib/NeedRestart/CONT/LXC.pm
2543++++ b/perl/lib/NeedRestart/CONT/LXC.pm
2544+@@ -81,7 +81,7 @@ sub check {
2545+ }
2546+
2547+ # look for LXC cgroups
2548+- return unless($cg =~ /^\d+:[^:]+:\/lxc(?:.payload)?[.\/]([^\/\n]+)($|\/)/m);
2549++ return unless($cg =~ /^\d+:[^:]*:\/lxc(?:.payload)?[.\/]([^\/\n]+)($|\/)/m);
2550+
2551+ my $name = $1;
2552+ my $type = ($self->{has_lxd} && -d qq($self->{lxd_container_path}/$name) ? 'LXD' : 'LXC');
2553+diff --git a/perl/lib/NeedRestart/CONT/machined.pm b/perl/lib/NeedRestart/CONT/machined.pm
2554+index c86ac48..bdeb5ec 100644
2555+--- a/perl/lib/NeedRestart/CONT/machined.pm
2556++++ b/perl/lib/NeedRestart/CONT/machined.pm
2557+@@ -68,7 +68,7 @@ sub check {
2558+ }
2559+
2560+ # look for machined cgroups
2561+- return 0 unless($cg =~ /^\d+:[^:]+:\/machine.slice\/machine-(.+)\.scope$/m);
2562++ return 0 unless($cg =~ /^\d+:[^:]*:\/machine.slice\/machine-(.+)\.scope$/m);
2563+
2564+ my $name = $1;
2565+ unless($norestart) {
2566+--
2567+2.35.1
2568+
2569diff --git a/debian/patches/Jammy-update-to-git-eb3531af-0044-Correct-syntax.patch b/debian/patches/Jammy-update-to-git-eb3531af-0044-Correct-syntax.patch
2570new file mode 100644
2571index 0000000..97dd19c
2572--- /dev/null
2573+++ b/debian/patches/Jammy-update-to-git-eb3531af-0044-Correct-syntax.patch
2574@@ -0,0 +1,37 @@
2575+Description: backport from git to stabilize jammy
2576+Origin: upstream, 8465c3eb9774ac2a07c8d1dd99a75c2bfdd10aa7
2577+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1965090
2578+Last-Update: 2022-03-17
2579+From 477e85b3f81702066f38f6caa0d6fbdf5c0e0003 Mon Sep 17 00:00:00 2001
2580+From: Mark Wagie <mark.wagie@tutanota.com>
2581+Date: Wed, 16 Mar 2022 08:37:00 -0600
2582+Subject: [PATCH] Correct syntax
2583+
2584+```
2585+Error parsing /etc/needrestart/needrestart.conf: Can't modify anonymous hash ({}) in scalar assignment at (eval 12) line 111, near "0,"
2586+Unmatched right curly bracket at (eval 12) line 112, at end of line
2587+syntax error at (eval 12) line 112, near "qr(^virtlockd)}"
2588+Unmatched right curly bracket at (eval 12) line 133, at end of line
2589+```
2590+---
2591+ ex/needrestart.conf | 4 ++--
2592+ 1 file changed, 2 insertions(+), 2 deletions(-)
2593+
2594+diff --git a/ex/needrestart.conf b/ex/needrestart.conf
2595+index 29d1e62..92f51f6 100644
2596+--- a/ex/needrestart.conf
2597++++ b/ex/needrestart.conf
2598+@@ -108,8 +108,8 @@ $nrconf{override_rc} = {
2599+ qr(^xendomains) => 0,
2600+ qr(^lxcfs) => 0,
2601+ qr(^libvirt) => 0,
2602+- qr(^virtlogd)} = 0,
2603+- qr(^virtlockd)} = 0,
2604++ qr(^virtlogd) => 0,
2605++ qr(^virtlockd) => 0,
2606+ qr(^docker) => 0,
2607+
2608+ # systemd stuff
2609+--
2610+2.35.1
2611+
2612diff --git a/debian/patches/series b/debian/patches/series
2613index 77eec81..a1df828 100644
2614--- a/debian/patches/series
2615+++ b/debian/patches/series
2616@@ -6,3 +6,44 @@
2617 06-dont-restart-bluetooth.diff
2618 07-runit.diff
2619 168.patch
2620+# Update based on git for various fixes before Jammy is released
2621+# Of the linear series from git patches 1/2/13/16/18/19 are already applied
2622+# above in the Debian packaging
2623+Jammy-update-to-git-eb3531af-0003-Update-ChangeLog.patch
2624+Jammy-update-to-git-eb3531af-0004-Update-ChangeLog.patch
2625+Jammy-update-to-git-eb3531af-0005-Fix-typo.patch
2626+Jammy-update-to-git-eb3531af-0006-Support-LXD-installed-through-snap.patch
2627+Jammy-update-to-git-eb3531af-0007-Handle-differences-in-cgroup-names-for-LXD-container.patch
2628+Jammy-update-to-git-eb3531af-0008-Fix-restarting-for-containers-in-LXD-projects.patch
2629+Jammy-update-to-git-eb3531af-0009-Update-documentation-for-LXC-LXD-support.patch
2630+Jammy-update-to-git-eb3531af-0010-Fix-typo-in-German-translation.patch
2631+Jammy-update-to-git-eb3531af-0011-Update-ChangeLog.patch
2632+Jammy-update-to-git-eb3531af-0012-systemd-manager-restart-Support-also-exe-usr-lib-sys.patch
2633+Jammy-update-to-git-eb3531af-0014-Update-ChangeLog.patch
2634+Jammy-update-to-git-eb3531af-0015-Update-ChangeLog.patch
2635+Jammy-update-to-git-eb3531af-0017-Update-ChangeLog.patch
2636+Jammy-update-to-git-eb3531af-0020-Update-LXC-D-cgroup-regex-for-LXC-4.0.patch
2637+Jammy-update-to-git-eb3531af-0021-Do-not-restart-elogind-by-default-205.patch
2638+Jammy-update-to-git-eb3531af-0022-Update-ChangeLog.patch
2639+Jammy-update-to-git-eb3531af-0023-Ignore-Java-Native-Access-mappings-closes-142-closes.patch
2640+Jammy-update-to-git-eb3531af-0024-Use-license-file-from-gnu.org.patch
2641+Jammy-update-to-git-eb3531af-0025-Fix-spelling.patch
2642+Jammy-update-to-git-eb3531af-0026-Fix-shellcheck-warnings.patch
2643+Jammy-update-to-git-eb3531af-0027-Trim-excess-whitespace.patch
2644+Jammy-update-to-git-eb3531af-0028-Update-README.batch.md.patch
2645+Jammy-update-to-git-eb3531af-0029-Ignore-all-memfd-mappings-Debian-Bug-972685-by-Micha.patch
2646+Jammy-update-to-git-eb3531af-0030-Kernel-Replace-strings-1-by-GNU-grep-to-drop-binutil.patch
2647+Jammy-update-to-git-eb3531af-0031-Do-not-print-perfdata-if-unknown-state.patch
2648+Jammy-update-to-git-eb3531af-0032-Add-icinga2-example-config.patch
2649+Jammy-update-to-git-eb3531af-0033-also-output-user-sessions-in-batch-mode.patch
2650+Jammy-update-to-git-eb3531af-0034-Update-README.batch.md.patch
2651+Jammy-update-to-git-eb3531af-0035-use-a-configurable-tolerance-when-checking-interpret.patch
2652+Jammy-update-to-git-eb3531af-0036-Fix-docker-detection-on-newer-Kernels.patch
2653+Jammy-update-to-git-eb3531af-0037-Default-override-virtlogd-virtlockd.patch
2654+Jammy-update-to-git-eb3531af-0038-Detect-and-report-outdated-VMs.patch
2655+Jammy-update-to-git-eb3531af-0039-VM-detection-improve-wording.patch
2656+Jammy-update-to-git-eb3531af-0040-VM-detection-fix-whitespace-damage.patch
2657+Jammy-update-to-git-eb3531af-0041-VM-detection-do-not-localize-guests-that-are-found.patch
2658+Jammy-update-to-git-eb3531af-0042-VM-detection-localize-normal-output-of-vm-detection.patch
2659+Jammy-update-to-git-eb3531af-0043-Fix-LXC-LXD-and-machined-detection-for-cgroups-v2.patch
2660+Jammy-update-to-git-eb3531af-0044-Correct-syntax.patch

Subscribers

People subscribed via source and target branches