1

I run Debian with Blackbox as my window manager which I start the old school way from a console with the startx command. In Debian 11 I had a problem with some GUI applications taking a very long time to start. Replacing

exec blackbox

with

exec dbus-launch --exit-with-session blackbox

in .xinitrc solved the problem. Today I upgraded to Debian 12 (a fresh installation) but now I have the same problem again, despite using dbus-launch. Firefox, for instance, takes 25 seconds to start the first time. Subsequent launches takes less than five seconds. I have tried to run firefox through the strace command to see what's going on:

$ strace firefox

Here are the last ten lines before the process hangs for a while:

futex(0x7f060049ca18, FUTEX_WAKE_PRIVATE, 1) = 1
eventfd2(0, EFD_CLOEXEC|EFD_NONBLOCK)   = 35
futex(0x7f0600500018, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f0600500018, FUTEX_WAIT_PRIVATE, 2, NULL) = -1 EAGAIN (Resource temporarily unavailable)
futex(0x7f0600500018, FUTEX_WAKE_PRIVATE, 1) = 0
write(27, "\1\0\0\0\0\0\0\0", 8)        = 8
clock_gettime(CLOCK_MONOTONIC, {tv_sec=6056, tv_nsec=849987069}) = 0
futex(0x7f060049ca18, FUTEX_WAKE_PRIVATE, 1) = 1
clock_gettime(CLOCK_MONOTONIC, {tv_sec=6056, tv_nsec=850085427}) = 0
poll([{fd=35, events=POLLIN}], 1, 25000

Can anyone interpret the output? What could be the problem?

0

1 Answer 1

2

This problem sounds just like the one I had running a different window manager (dwm), but starting in the same way from the console terminal. The symptoms included the slow launch of firefox which took about 30+ seconds to launch. After the solutions below, that was reduced to about 8 seconds.

This problem was resolved in two ways on different computers.

First, the following line was added to .xinitrc, and X restarted:

dbus-update-activation-environment --systemd DBUS_SESSION_BUS_ADDRESS DISPLAY XAUTHORITY &

The second solution on another computer was guided by this debian advice on the use of .xsession instead of .xinitrc: https://wiki.debian.org/Xsession. When .xsession replaced .xinitrc, the "dbus-update-activation-environment" command was unnecessary and not included in the .xsession file since it's run from /etc/X11/Xsession.d. Otherwise, the original commands and options of the .xinitrc were copied into the new .xsession file, and the .xinitrc file was removed.

4
  • I first tried to simply rename .xinitrc to .xsession. It made no difference. Then I added the command you proposed to .xsession, just before the command that starts blackbox. It made no difference either. The affected applications still takes a very long time to start. Jun 11, 2023 at 22:04
  • Did you add the "dbus-update-activation-environment" to .xinitrc and restart X? That worked. I'm sorry the .xsession didn't work, but there's no need for this command in it.
    – currawong
    Jun 11, 2023 at 22:13
  • The problem turned out to be the line exec dbus-launch --exit-with-session blackbox. Using the dbus-update-activation-environment command with just exec blackbox did the trick. Now there is no delay. Thank you very much! Jun 12, 2023 at 18:01
  • And, as you mention, renaming .xinitrc to .xsession and removing the dbus-update-activation-environment command also works and is probably preferable. Jun 12, 2023 at 18:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .