WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

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

Offline GNUser

  • Full Member
  • ***
  • Posts: 230
init runs dbus-launch when user runs yad!?
« on: October 15, 2019, 11:12:31 AM »
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, 11:18:16 AM by GNUser »

Offline GNUser

  • Full Member
  • ***
  • Posts: 230
Re: init runs dbus-launch when user runs yad!?
« Reply #1 on: October 15, 2019, 06: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

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 6959
Re: init runs dbus-launch when user runs yad!?
« Reply #2 on: October 15, 2019, 08: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: 11107
Re: init runs dbus-launch when user runs yad!?
« Reply #3 on: October 15, 2019, 10:58:45 PM »
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

  • Full Member
  • ***
  • Posts: 230
Re: init runs dbus-launch when user runs yad!?
« Reply #4 on: October 16, 2019, 06: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

  • Full Member
  • ***
  • Posts: 230
Re: init runs dbus-launch when user runs yad!?
« Reply #5 on: October 16, 2019, 12: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...