Bug#1024426: needrestart: notify-send timeout - WA

2023-05-03 Thread Michał Mirosław
I've stumbled upon this issue after upgrading to bookworm. In my case
the timeout was both due to pam_mount and Roland's missing session
environment case. Fixed both by replacing `su` invocation with:

runuser -p -l -u "$NR_USERNAME" -- "$NSEND" -a needrestart -u critical -i 
dialog-warning "$MSGTITLE" "$MSGBODY"

-- 
Michał Mirosław



Bug#1024426:

2022-11-30 Thread Andreas Sundstrom

I have had the same problem as Roland for a long time and today I finally 
decided to troubleshoot it.

Quickly came to the conclusion that notify-send was the culprit.

Through trial and error I added this to my 400-notify-send script to get it 
working:
export XDG_RUNTIME_DIR=$(sed -z -n s/^XDG_RUNTIME_DIR=//p 
"/proc/$NR_SESSPPID/environ")

Then I found this bug and I tried Rolands solution and it also works for me.
I have no idea which solution may be more appropriate or not.

I run KDE and this is Debian Bullseye (currently Debian stable) but the 
400-notify-script
has not changed between the releases (except whitespace and comments).

Regards
Andreas



Bug#1024426: needrestart: notify-send timeout instead of notify

2022-11-19 Thread Roland Rosenfeld
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-perl0.15-1
ii  libmodule-scandeps-perl1.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-tool2.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")


signature.asc
Description: PGP signature