WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: init runs dbus-launch when user runs yad!?  (Read 3670 times)

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
init runs dbus-launch when user runs yad!?
« on: October 15, 2019, 02:12:31 PM »
I'm on Pure64 10.1 with fluxbox. dbus is installed because some applications (e.g., filezilla) require it, but is almost never running.

Today I discovered something quite bizarre: If dbus is loaded, anytime I run yad to create a notification icon, something starts dbus...

Code: [Select]
bruno@box:~$ pgrep -fa dbus # note there are no hits
bruno@box:~$ yad --notification --image=dialog-error --text="testing" &
bruno@box:~$ pgrep -fa dbus
8504 dbus-launch --autolaunch b67e35c57ed5e6cf8ef0f5b65da5d7b3 --binary-syntax --close-stderr
8505 /usr/local/bin/dbus-daemon --syslog-only --fork --print-pid 5 --print-address 7 --session
8511 /usr/local/bin/dbus-daemon --config-file=/usr/local/share/defaults/at-spi2/accessibility.conf --nofork --print-address 3

...and it seems the culprit is /sbin/init (PID 1):
Code: [Select]
bruno@box:~$ ps -o pid -o ppid | grep 8504
8504    1

I'm baffled. Why is init doing that? yad works fine without dbus. I'd like init to not launch dbus every time I use yad. Any ideas how to accomplish this?
« Last Edit: October 15, 2019, 02:18:16 PM by GNUser »

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: init runs dbus-launch when user runs yad!?
« Reply #1 on: October 15, 2019, 09:45:56 PM »
Processes whose parent has exited are reparented to init by the kernel. So children of init are in fact not normally directly started by that process.

That being the case, init is probably innocent here: it most likely is inheriting dbus-launch by whatever it is that triggered it.

So my real, more general, question is this: What starts dbus-launch and when/why?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11704
Re: init runs dbus-launch when user runs yad!?
« Reply #2 on: October 15, 2019, 11:19:39 PM »
Hi GNUser
Maybe  dmesg  or  syslog  can catch who's doing it. Maybe bump up the log level first.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14851
Re: init runs dbus-launch when user runs yad!?
« Reply #3 on: October 16, 2019, 01:58:45 AM »
This is the first time I've seen dbus started in such a way - apps that use dbus to start other stuff (gnome-session, pulseaudio) need dbus to be started first.

It seems to be yad that is starting dbus, possibly to make atk available?

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: init runs dbus-launch when user runs yad!?
« Reply #4 on: October 16, 2019, 09:36:21 AM »
I substituted /usr/local/bin/dbus-launch with a shell script that logs PID, PPID, and output of 'ps -ef' (dbus might be sneaky, but I'm sneakier ;))

Yad just got busted: According to the log, the parent process of dbus-launch (before init adopts it) is yad.

It is upsetting that yad doesn't actually need dbus (it works just as well without dbus being loaded) but starts it anyway if it's available.

I found a tiny replacement for yad that does only what I need, without any nonsense. The code is old but compiles just fine and works perfectly:
https://github.com/jonhoo/mktrayicon


Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: init runs dbus-launch when user runs yad!?
« Reply #5 on: October 16, 2019, 03:37:38 PM »
yad developer's workaround (per our conversation here):
Code: [Select]
NO_AT_BRIDGE=1 yad <arguments>I don't understand why it works, need to educate myself further...