只有 root 才能发送通知

只有 root 才能发送通知

我知道另外两篇文章描述了同样的问题,但是那里提出的解决方案对我来说都没有用。

我正在运行Ubuntu 22.04.3 LTS并将其用作GNOME 42.9我的桌面环境。

问题说明

我的主要问题是以notify-send普通用户身份使用会导致以下错误消息:

robin@robin-workstation:~$ notify-send "test"
Error calling StartServiceByName for org.freedesktop.Notifications: Process org.freedesktop.Notifications received signal 11

似乎没有与通知相关的进程正在运行,这就是错误消息中提到“StartServiceByName”的原因,它可能是试图启动服务,因为这是第一次需要它。但是启动服务似乎因段错误而失败(如果我没有看错,信号 11 = 段错误)。

当我尝试启动我notification-daemon自己时,我确实遇到了分段错误:

robin@robin-workstation:~$ /usr/lib/notification-daemon/notification-daemon
Segmentation fault

当尝试使用 以 root 身份运行相同的程序时sudo,它只是挂在我的终端上。有趣的是,当我在它挂起时查看正在运行的程序时,我确实在正在运行的程序列表中看到了它,但尝试通知发送仍然失败并显示相同的错误消息...

robin@robin-workstation:~$ ps aux | grep notification
robin       2262  0.0  0.0 250308 11892 ?        Ssl  14:42   0:00 /usr/libexec/gsd-print-notifications
root        7254  0.2  0.0  14268  5700 pts/0    S+   15:27   0:00 sudo /usr/lib/notification-daemon/notification-daemon
root        7255  2.4  0.1 263632 22144 pts/0    Sl+  15:27   0:00 /usr/lib/notification-daemon/notification-daemon
robin       7268  0.0  0.0   9216  2276 pts/2    S+   15:27   0:00 grep --color=auto notification
robin@robin-workstation:~$ notify-send "test"
Error calling StartServiceByName for org.freedesktop.Notifications: Process org.freedesktop.Notifications received signal 11

附加信息

我没有使用notify-osd(它没有安装在我的计算机上)。libnotify-bin并且notification-daemon安装了最新版本:

robin@robin-workstation:~$ sudo apt install notification-daemon
notification-daemon is already the newest version (3.20.0-4build1).

robin@robin-workstation:~$ sudo apt install libnotify-bin
libnotify-bin is already the newest version (0.7.9-3ubuntu5.22.04.1).

通知文件的内容.service看起来合法(这是有道理的,问题似乎不是系统找不到服务,而是由于段错误而无法启动它):

robin@robin-workstation:~$ cat /usr/share/dbus-1/services/org.freedesktop.Notifications.service
[D-BUS Service]
Name=org.freedesktop.Notifications
Exec=/usr/lib/notification-daemon/notification-daemon

我已尝试重新安装notification-daemonlibnotify-bin,但没有效果。

任何值得研究的想法都将受到赞赏!谢谢!

根据要求这是我的env

SHELL=/bin/bash
SESSION_MANAGER=local/robin-workstation:@/tmp/.ICE-unix/2119,unix/robin-workstation:/tmp/.ICE-unix/2119
QT_ACCESSIBILITY=1
COLORTERM=truecolor
XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg
SSH_AGENT_LAUNCHER=gnome-keyring
XDG_MENU_PREFIX=gnome-
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
LANGUAGE=en_GB:en
LC_ADDRESS=fr_FR.UTF-8
GNOME_SHELL_SESSION_MODE=ubuntu
LC_NAME=fr_FR.UTF-8
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
XMODIFIERS=@im=ibus
DESKTOP_SESSION=ubuntu
LC_MONETARY=fr_FR.UTF-8
GTK_MODULES=gail:atk-bridge
PWD=/home/robin
LOGNAME=robin
XDG_SESSION_DESKTOP=ubuntu
XDG_SESSION_TYPE=wayland
SYSTEMD_EXEC_PID=2308
XAUTHORITY=/run/user/1000/.mutter-Xwaylandauth.3SZDE2
HOME=/home/robin
USERNAME=robin
IM_CONFIG_PHASE=1
LC_PAPER=fr_FR.UTF-8
LANG=en_GB.UTF-8
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00[...]
XDG_CURRENT_DESKTOP=ubuntu:GNOME
VTE_VERSION=6800
WAYLAND_DISPLAY=wayland-0
GNOME_TERMINAL_SCREEN=/org/gnome/Terminal/screen/5df7e24d_8b5c_40c5_a6a3_3c74bdc3c336
GNOME_SETUP_DISPLAY=:1
LESSCLOSE=/usr/bin/lesspipe %s %s
XDG_SESSION_CLASS=user
TERM=xterm-256color
LC_IDENTIFICATION=fr_FR.UTF-8
LESSOPEN=| /usr/bin/lesspipe %s
USER=robin
GNOME_TERMINAL_SERVICE=:1.104
DISPLAY=:0
SHLVL=1
LC_TELEPHONE=fr_FR.UTF-8
QT_IM_MODULE=ibus
LC_MEASUREMENT=fr_FR.UTF-8
PAPERSIZE=a4
XDG_RUNTIME_DIR=/run/user/1000
LC_TIME=fr_FR.UTF-8
XDG_DATA_DIRS=/usr/share/ubuntu:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop
PATH=/home/robin/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin
GDMSESSION=ubuntu
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
LC_NUMERIC=fr_FR.UTF-8
_=/usr/bin/env
OLDPWD=/home/robin

相关内容