Package: needrestart
Version: 3.6-2
Severity: important
Tags: patch

Dear Maintainer,

some months ago needrestart topped sending notify events on my system
and instead run into a timeout.

Today I debugged this issue and found out, that the command
 su -p -s /bin/sh -c "$NSEND -a needrestart -u critical -i dialog-warning 
\"$MSGTITLE\" \"$MSGBODY\"" "$NR_USERNAME"
in /etc/needrestart/notify.d/400-notify-send does not work correct on
my system, if DBUS_SESSION_BUS_ADDRESS is unset.

Simply exporting DBUS_SESSION_BUS_ADDRESS, which is already evaluated
in line 32 of the script, but not exported, solved the issue for me.

A patch is attached.

I'm not sure, what triggered breaking the function for my system (I'm
quite sure, that it worked correct some time ago).  Maybe the problem
is triggered by using tcsh as user shell (but I use this shell for
ages).

Since the above minimal patch solves the issue for me, it may be a
good idea to apply it :-)

Greetings
Roland

-- System Information:
Debian Release: 11.5
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 
'stable'), (50, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.10.0-19-amd64 (SMP w/4 CPU threads)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=de_DE.utf-8, LC_CTYPE=de_DE.utf-8 (charmap=UTF-8), 
LANGUAGE=de_DE:de:en_GB:en
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages needrestart depends on:
ii  binutils                   2.35.2-2
ii  dpkg                       1.20.12
ii  gettext-base               0.21-4
ii  libintl-perl               1.26-3+deb11u1
ii  libmodule-find-perl        0.15-1
ii  libmodule-scandeps-perl    1.30-1
ii  libproc-processtable-perl  0.59-2+b1
ii  libsort-naturally-perl     1.03-2
ii  libterm-readkey-perl       2.38-1+b2
ii  perl                       5.32.1-4+deb11u2
ii  xz-utils                   5.2.5-2.1~deb11u1

Versions of packages needrestart recommends:
ii  libpam-systemd  247.3-7+deb11u1
ii  systemd         247.3-7+deb11u1

Versions of packages needrestart suggests:
ii  iucode-tool    2.3.1-1
ii  libnotify-bin  0.7.9-3
diff --git a/needrestart/notify.d/400-notify-send b/needrestart/notify.d/400-notify-send
index 77abb124..9876c17f 100755
--- a/needrestart/notify.d/400-notify-send
+++ b/needrestart/notify.d/400-notify-send
@@ -33,6 +33,7 @@ case "$NR_SESSION" in
     if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
         unset DBUS_SESSION_BUS_ADDRESS
     fi
+    export DBUS_SESSION_BUS_ADDRESS
 
     export DISPLAY=$(sed -z -n s/^DISPLAY=//p "/proc/$NR_SESSPPID/environ")
     export XAUTHORITY=$(sed -z -n s/^XAUTHORITY=//p "/proc/$NR_SESSPPID/environ")

Attachment: signature.asc
Description: PGP signature

  • Bug#1024426: needrestart: notify-send timeout instead of... Roland Rosenfeld

Reply via email to