! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
xfce4-notifyd should be started on login, not by dbus
Status:
RESOLVED: MOVED
Product:
Xfce4-notifyd
Component:
general

Comments

Description Marcin Kocur 2020-04-13 16:47:28 CEST
Current behavior: xfce4-notifyd is started by dbus when message comes
Expected behavior: xfce4-notifyd is started on Xfce start, not by dbus.

Explanation:

Xfce4-notifyd installs a file /usr/share/dbus-1/services/org.xfce.xfce4-notifyd.Notifications.service

KDE installs a file /usr/share/dbus-1/services/org.kde.plasma.Notifications.service

They both say:
[D-BUS Service]
Name=org.freedesktop.Notifications

In the effect, they conflict with each other and dbus doesn't know which one to launch. 


So what happens if we're running Xfce and trying to receive a notification when KDE's file is installed? We get no notification because dbus tries to send it to plasma:

linux dbus-daemon[588]: [session uid=1000 pid=588] Activating service name='org.freedesktop.Notifications' requested by ':1.41' (uid=1000 pid=830 comm="notify-send test ")
inux plasma_waitforname[834]: org.kde.knotifications: WaitForName: Service was not registered within timeout
linux dbus-daemon[588]: [session uid=1000 pid=588] Activated service 'org.freedesktop.Notifications' failed: Process org.freedesktop.Notifications exited with status 1

What happens if we remove KDE's file? Well, everything works:

[mk@linux ~]$ systemctl --user status xfce4-notifyd
● xfce4-notifyd.service - XFCE notifications service
     Loaded: loaded (/usr/lib/systemd/user/xfce4-notifyd.service; static; vendor pre>
     Active: inactive (dead)

[mk@linux ~]$ notify-send  "test"
[mk@linux ~]$ systemctl --user status xfce4-notifyd
● xfce4-notifyd.service - XFCE notifications service
     Loaded: loaded (/usr/lib/systemd/user/xfce4-notifyd.service; static; vendor pre>
     Active: active (running) since Mon 2020-04-13 15:52:43 CEST; 2s ago
   Main PID: 840 (xfce4-notifyd)
     CGroup: /user.slice/user-1000.slice/user@1000.service/xfce4-notifyd.service
             └─840 /usr/lib/xfce4/notifyd/xfce4-notifyd


[mk@linux ~]$ journalctl |grep 'XFCE notifications'
kwi 13 15:52:43 linux systemd[579]: Starting XFCE notifications service...
kwi 13 15:52:43 linux systemd[579]: Started XFCE notifications service.


According to Yaakov Selkowitz in https://bugzilla.redhat.com/show_bug.cgi?id=484945 a desktop environment should launch the notification system on it's start. Indeed, launching xfce4-notifyd manually via systemctl --user status xfce4-notifyd resolves the issue, until next reboot.

What ToZ is saying on the forums (https://forum.xfce.org/viewtopic.php?pid=46014#p46014) "xfce4-notifyd should be started (and restarted as needed) via dbus".

So please consider if changing to autostart on login isn't a better idea.
Comment 1 Marcin Kocur 2020-04-14 19:53:21 CEST
There is also another funny side effect for this bug:
if you have a usb drive and you click the eject icon in Thunar for it, then Thunar will freeze. It's because it tries to show notification that the volume can be now disconnected.
Comment 2 Simon Steinbeiss editbugs 2020-04-23 15:49:02 CEST
From my point of view it's up to distributions to decide if they want to autostart notifyd with systemd.
(Please note that notifyd is also supporting *BSD or distributions that come without systemd, so for these cases the DBUS startup is really fine.)

The only thing I could imagine is better error handling to notify the user that "the wrong notification service is running" (although it's really hard to tell for Xfce what the user wants - after all we try to be modular and you can use it just as well with KDE Plasma's notification service).

Do you have any other suggestions?
Comment 3 Marcin Kocur 2020-04-23 20:48:12 CEST
I never said notifyd should be started from systemd. Can't it be just launched as a Xfce service for particular user?
Comment 4 Git Bot editbugs 2020-05-24 20:08:07 CEST
-- GitLab Migration Automatic Message --

This bug has been migrated to xfce.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.xfce.org/apps/xfce4-notifyd/-/issues/27.

Please create an account or use an existing account on one of our supported OAuth providers. 

If you want to fork to submit patches and merge requests please continue reading here: https://docs.xfce.org/contribute/dev/git/start#gitlab_forks_and_merge_requests

Also feel free to reach out to us on the mailing list https://mail.xfce.org/mailman/listinfo/xfce4-dev

Bug #16690

Reported by:
Marcin Kocur
Reported on: 2020-04-13
Last modified on: 2020-05-24

People

Assignee:
Simon Steinbeiss
CC List:
0 users

Version

Attachments

Additional information