7

I can't find a way to find what program implements the org.freedesktop.Notifications service. Is it possible to ask DBus to tell me what program provides it?

The reason for asking this question is quite banal: I found a new desktop notifications daemon I'd like to use, but it won't start and instead complains with this message

Name Lost. Is Another notification daemon running?

However, I am unable to determine what program is holding the name. I already uninstalled every other notification daemon, restarted X server, and even rebooted the machine.

However, when I run this command:

dbus-send --session --dest=org.freedesktop.DBus --type=method_call \
--print-reply /org/freedesktop/DBus org.freedesktop.DBus.ListNames

string "org.freedesktop.Notifications" is present in the output, so something is holding the name, and I can't start my desired daemon.

  • 1
    I don't know of a way to get this information generically, but in this case the particular service you're asking about is usually provided by a daemon bundled with your desktop environment (Cinnamon, XFCE4, and MATE all do it this way), and it's usually somewhat difficult to get the desktop to use a different notification daemon if it comes with one bundled. – Austin Hemmelgarn Jul 20 '17 at 19:21
  • @AustinHemmelgarn Thanks. I'm running AwesomeWM which does not bundle notifications daemon (I'm not actually sure about it, I'll investigate, thanks for the clue). – Mael Jul 20 '17 at 19:29
  • 1
    I think AwesomeWM provides the service itself internally actually (at least, on Gentoo and Debian it appears to be recognized as a notification provider). If not, the most likely possibility is 'notify-osd', as that's the most widely used desktop-agnostic notification daemon out there. – Austin Hemmelgarn Jul 20 '17 at 19:34
  • @AustinHemmelgarn You've pointed me in the right direction! It was enough to comment out require("naughty") in Awesome's config, restart, and I was able to launch the daemon I wanted. – Mael Jul 20 '17 at 19:43
  • 1
    @AustinHemmelgarn I dont know how it does it, but d-feet found a pid. See my answer. – meuh Jul 21 '17 at 15:05
5

The d-bus debug utility d-feet which is available as a package in many systems seems to be able to find the process id and command providing a service. For example, I ran it on a Fedora 23 xfce4 X11 systemd platform and selected Session Bus and entered the service name org.freedesktop.Notifications. It introspected the service, activating it, and showed the pid and /usr/lib64/xfce4/notifyd/xfce4-notifyd command:

before activation

after activation

6

You can get the caller PID via org.freedesktop.DBus.GetConnectionUnixProcessID:

gdbus call --session --dest org.freedesktop.DBus --object-path / --method \
org.freedesktop.DBus.GetConnectionUnixProcessID org.freedesktop.Notifications

prints

(uint32 737,)

so there's your PID. If you prefer dbus-send (as gdbus is GNOME specific) then:

dbus-send --session --print-reply --dest=org.freedesktop.DBus / \
org.freedesktop.DBus.GetConnectionUnixProcessID string:org.freedesktop.Notifications

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.