You are not logged in.

#1 2023-10-07 03:41:11

Kocsonya
Member
Registered: 2023-10-07
Posts: 16

Firefox is already running error message

I have an Arch installation with the following problem:

If firefox is open and I click on a link in an email, the mailer passes the link to firefox by invoking
firefox '%s'
I would expect firefox to open the link in a new tab or a new window.
Instead, I get an error message informing me that firefox is already running and I should quit it.
The same is true if any application attempts to open a page by exec-ing firefox with the link (e.g. an app that uses a web page to show help).


firefox is started with no command line options, the /usr/bin/firefox shell script that actually starts the binary in /usr/lib/firefox/ does not add -no-remote to the command line.

I could not find any config options for firefox that would tell it to open the link if it sees that it has been started again. I know that at least older versions worked as expected.
And there is no man page for firefox.

Any help would me much appreciated.

Thanks,

Kocsonya

Offline

#2 2023-10-07 06:20:30

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 72,033

Re: Firefox is already running error message

type firefox
firefox 'https://bbs.archlinux.org/' # same issue when invoking from a console?
ps aux | grep firefox
strace -f -tt -o /tmp/firefox.strace firefox 'https://bbs.archlinux.org/' # if the console invocatio causes the same

Edit: and post the strace to 0x0.st

Last edited by seth (2023-10-07 06:20:49)

Offline

#3 2023-10-07 07:19:51

Kocsonya
Member
Registered: 2023-10-07
Posts: 16

Re: Firefox is already running error message

[zoltan@menyus ~]$ firefox
[GFX1-]: vaapitest: ERROR
[GFX1-]: vaapitest: VA-API test failed: failed to initialise VAAPI connection.

then the usual message window pops up.

[zoltan@menyus ~]$ ps aux | grep firefox
zoltan     11525  2.2  1.9 11827672 645592 tty1  Sl   14:23   5:16 /usr/lib/firefox/firefox https://bbs.archlinux.org/login.php
zoltan     11613  0.0  0.1 239960 43264 tty1     Sl   14:23   0:00 /usr/lib/firefox/firefox -contentproc -parentBuildID 20230925122949 -prefsLen 31156 -prefMapSize 233526 -appDir /usr/lib/firefox/browser {28b3320f-9c2b-42e0-8cff-5e76c8df7315} 11525 true socket
zoltan     11639  0.3  0.5 2608408 165520 tty1   Sl   14:23   0:45 /usr/lib/firefox/firefox -contentproc -childID 1 -isForBrowser -prefsLen 24578 -prefMapSize 233526 -jsInitLen 234236 -parentBuildID 20230925122949 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appDir /usr/lib/firefox/browser {d6b72211-f9ca-4ac0-8008-9396fb7f0d09} 11525 true tab
zoltan     11705  0.0  0.5 2651032 194192 tty1   Sl   14:23   0:04 /usr/lib/firefox/firefox -contentproc -childID 2 -isForBrowser -prefsLen 36477 -prefMapSize 233526 -jsInitLen 234236 -parentBuildID 20230925122949 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appDir /usr/lib/firefox/browser {45e63764-66b6-41c4-a169-7793b3d7c8f9} 11525 true tab
zoltan     11762  0.0  0.1 238952 41728 tty1     Sl   14:23   0:00 /usr/lib/firefox/firefox -contentproc -parentBuildID 20230925122949 -sandboxingKind 0 -prefsLen 36477 -prefMapSize 233526 -appDir /usr/lib/firefox/browser {73dd4576-d1e5-493c-ad77-7736933073ab} 11525 true utility
zoltan     11770  0.1  0.3 2499872 114672 tty1   Sl   14:23   0:14 /usr/lib/firefox/firefox -contentproc -childID 3 -isForBrowser -prefsLen 36477 -prefMapSize 233526 -jsInitLen 234236 -parentBuildID 20230925122949 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appDir /usr/lib/firefox/browser {35d35ce2-3f85-4e4e-af47-af1fce581622} 11525 true tab
zoltan     12004  0.0  0.6 2641344 215488 tty1   Sl   14:43   0:10 /usr/lib/firefox/firefox -contentproc -childID 6 -isForBrowser -prefsLen 29702 -prefMapSize 233526 -jsInitLen 234236 -parentBuildID 20230925122949 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appDir /usr/lib/firefox/browser {f5c6d89f-7310-435f-bf00-a7a72ccd2dc2} 11525 true tab
zoltan     12839  0.0  0.4 2537604 130460 tty1   Sl   16:39   0:02 /usr/lib/firefox/firefox -contentproc -childID 7 -isForBrowser -prefsLen 29702 -prefMapSize 233526 -jsInitLen 234236 -parentBuildID 20230925122949 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appDir /usr/lib/firefox/browser {b1b62b6c-f75e-4c11-bc47-61efa62b3e73} 11525 true tab
zoltan     12942  0.2  0.7 2677812 240016 tty1   Sl   16:42   0:13 /usr/lib/firefox/firefox -contentproc -childID 9 -isForBrowser -prefsLen 29702 -prefMapSize 233526 -jsInitLen 234236 -parentBuildID 20230925122949 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appDir /usr/lib/firefox/browser {e6405ce7-f796-4aa2-904d-e0f38ad15603} 11525 true tab
zoltan     13102  0.0  0.3 2527048 119544 tty1   Sl   16:48   0:03 /usr/lib/firefox/firefox -contentproc -childID 11 -isForBrowser -prefsLen 29702 -prefMapSize 233526 -jsInitLen 234236 -parentBuildID 20230925122949 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appDir /usr/lib/firefox/browser {4a506f1e-bee4-4134-a920-78bd25175c76} 11525 true tab
zoltan     13158  0.0  0.4 2564932 156284 tty1   Sl   16:49   0:02 /usr/lib/firefox/firefox -contentproc -childID 12 -isForBrowser -prefsLen 29702 -prefMapSize 233526 -jsInitLen 234236 -parentBuildID 20230925122949 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appDir /usr/lib/firefox/browser {43371a59-6c92-4833-b6b4-04ac1e4b28d7} 11525 true tab
zoltan     13201  0.0  0.4 2559864 141460 tty1   Sl   16:49   0:03 /usr/lib/firefox/firefox -contentproc -childID 13 -isForBrowser -prefsLen 29702 -prefMapSize 233526 -jsInitLen 234236 -parentBuildID 20230925122949 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appDir /usr/lib/firefox/browser {d861e4bf-5de8-4262-91f6-0e8169d8b918} 11525 true tab
zoltan     13244  0.6  0.7 2696288 251192 tty1   Sl   16:49   0:33 /usr/lib/firefox/firefox -contentproc -childID 14 -isForBrowser -prefsLen 29702 -prefMapSize 233526 -jsInitLen 234236 -parentBuildID 20230925122949 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appDir /usr/lib/firefox/browser {43fdfd9f-25c5-4dcc-b3d4-5bfdde6d2e45} 11525 true tab
zoltan     14298  0.0  0.0   6552  2560 pts/6    S+   18:13   0:00 grep firefox
[zoltan@menyus ~]$

strace generates 36K lines of text , I don't know how to attach a tgz file to the post (or whether you can do that at all).

Thanks!!!

Kocsonya

Offline

#4 2023-10-07 09:11:50

karabaja4
Member
From: Croatia
Registered: 2008-09-14
Posts: 1,035
Website

Re: Firefox is already running error message

Is this the message?

3jLz9.png

If it is, you may be interested to know that Firefox 94 switched from X11 magic to D-Bus to communicate existing running instances that a new window or tab should be opened when /usr/bin/firefox is run. That means that you need D-Bus running and DBUS_SESSION_BUS_ADDRESS set correctly.

Offline

#5 2023-10-07 11:53:04

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 72,033

Re: Firefox is already running error message

Please use code tags, https://bbs.archlinux.org/help.php#bbcode - edit your posts in this regard.
You can upload the strace

cat /tmp/firefox.strace | curl -F 'file=@-' 0x0.st

but karabaja4 answered one of the most interesting questions.

loginctl session-status
echo $DBUS_SESSION_BUS_ADDRESS

Offline

#6 2023-10-07 16:35:12

Kocsonya
Member
Registered: 2023-10-07
Posts: 16

Re: Firefox is already running error message

SOLVED.
The problem was the D-bus issue. Putting
export $(dbus-launch)
into .xsession fixed firefox (and some other issues as well).

Thanks for everyone who responded!

Kocsonya

Offline

#7 2023-10-07 16:37:17

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,413

Re: Firefox is already running error message

That is NOT the way to solve this. dbus is launched and managed by systemd, post the info requested to get this actually fixed.

Offline

#8 2023-10-07 17:16:10

Kocsonya
Member
Registered: 2023-10-07
Posts: 16

Re: Firefox is already running error message

Uploaded the strace, http://0x0.st/HWD6.txt.
Nevertheless, without starting the daemon in .xsession, the DBUS_SESSION_BUS_ADDRESS is not defined in the X session.

Thanks,

Kocsonya

Offline

#9 2023-10-07 17:17:52

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 72,033

Re: Firefox is already running error message

Do not use dbus-launch.

loginctl session-status
echo $DBUS_SESSION_BUS_ADDRESS

And most likely see the last link below.

Offline

#10 2023-10-08 19:42:49

lilikoi
Member
Registered: 2022-02-01
Posts: 23

Re: Firefox is already running error message

I run XFCE and Tmux inside XTerm, and was having the same error popping up when trying to open a URL from the terminal.

The following solved the problem for me, and is kept at ~/.zshrc:

#set DBUS (and other envars) for Tmux
if [[ -n $TMUX && -z $DBUS_SESSION_BUS_ADDRESS ]]
then
	pidof -q xfce4-session &&
	export $(xargs --null --max-args=1 < /proc/$(pidof xfce4-session)/environ \
	| grep -e DBUS_SESSION_BUS_ADDRESS -e XDG_ -e CDM_SPAWN -e DESKTOP_SESSION \
	-e GTK3_ -e GTK_ -e LC_ -e MAIL -e MOTD_SHOWN -e PANEL_GDK_CORE_DEVICE_EVENTS \
	-e SESSION_MANAGER -e WINDOWPATH)
	#https://askubuntu.com/questions/772631/how-to-connect-screen-tmux-byobu-to-dbus
fi

Note this command is specific for my system environment, you need adjusting it for your system, depending on the envars you need importing.

Last edited by lilikoi (2023-10-09 11:20:07)

Offline

#11 2023-10-08 19:58:20

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 72,033

Re: Firefox is already running error message

You're probably starting the tmux daemon outside/before the session, resp. before the session environment is imported?

Offline

#12 2023-10-09 10:31:18

lilikoi
Member
Registered: 2022-02-01
Posts: 23

Re: Firefox is already running error message

Hello, Seth.

Indeed, the tmux server is started before the login, as per Arch Wiki option.

Last edited by lilikoi (2023-10-09 11:18:31)

Offline

#13 2023-10-09 13:39:47

Kocsonya
Member
Registered: 2023-10-07
Posts: 16

Re: Firefox is already running error message

At the moment for a particular reason I start the login manager (sddm) from the command line (as root).
I then log into the X session as a normal user. There's no desktop, it's just an fvwm2 window manager.
The dbus address env. var. exists in the login console, but it does not get propagated to the user session in X.
I did not find a command that can query the bus address of an already running daemon (which might be my severe lack of knowledge about systemd and dbus).
Given the particular situation, what would be the canonical way of passing the dbus address to the X session?

Thanks,

Kocsonya

Offline

#14 2023-10-09 16:56:00

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 72,033

Re: Firefox is already running error message

At the moment for a particular reason I start the login manager (sddm) from the command line (as root).

Do you start the process or the service?

The dbus address env. var. exists in the login console, but it does not get propagated to the user session in X.

At t he login console for the root user?

SDDM is supposed to activate a proper session for you, regardless whether it's fvwm or some DE, please post the loginctl status.

Offline

#15 2023-10-09 17:07:03

Kocsonya
Member
Registered: 2023-10-07
Posts: 16

Re: Firefox is already running error message

This is the whole process:

(boot)
login: root
password: <password>
# sddm
(the greeter comes up, logging in as normal user)
X + window manager is running

loginctl lists 2 entries.
The first one is root, session 1, tty1, online.
The second is me, session 8 on tty2, online. On that one the status:

[zoltan@menyus ~]$ loginctl session-status 8
8 - zoltan (1000)
           Since: Mon 2023-10-09 13:47:36 AEDT; 12h ago
          Leader: 1590 (login)
            Seat: seat0; vc2
             TTY: tty2
         Service: login; type tty; class user
           State: online
            Idle: yes since Mon 2023-10-09 17:10:38 AEDT (10h ago)
            Unit: session-8.scope
                  ├─1590 "login -- zoltan"
                  └─5231 -bash
[zoltan@menyus ~]$

Offline

#16 2023-10-09 17:09:46

Kocsonya
Member
Registered: 2023-10-07
Posts: 16

Re: Firefox is already running error message

Forgot to mention: X, sddm and in general the whole system is as configured by default.

Offline

#17 2023-10-09 17:26:55

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 72,033

Re: Firefox is already running error message

session 8 is not a graphical login?
The session that matters is where FF complains.

Offline

#18 2023-10-09 17:40:15

Kocsonya
Member
Registered: 2023-10-07
Posts: 16

Re: Firefox is already running error message

Did a reboot, starting with a clean slate. Text console (tty1), login as root, start sddm, graphical greeter, login as user.
I have firefox and an xterm open. Now the output:

[zoltan@menyus ~]$ loginctl
SESSION UID USER SEAT  TTY  STATE  IDLE SINCE
      1   0 root seat0 tty1 online no        

1 sessions listed.
[zoltan@menyus ~]$  loginctl list-users
UID USER LINGER STATE 
  0 root no     online

1 users listed.
[zoltan@menyus ~]$ 

Offline

#19 2023-10-09 17:47:53

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 72,033

Re: Firefox is already running error message

What are the specific reasons fot that SDDM start?
Because it doesn't seem to integrate w/ logind at all?

Offline

#20 2023-10-09 18:17:10

Kocsonya
Member
Registered: 2023-10-07
Posts: 16

Re: Firefox is already running error message

No. It's a Dell laptop (G16, w/ NVidia). It's a gamer machine, but I don't do gaming, I needed a portable productivity machine with lots of grunt and a good display, both of which it has, at a reasonable price.

Nevertheless, I need to tweak xorg.conf for X do everything that I want it to do. Alas, when the config is not exactly for its liking, it sometimes locks up (so I can't switch to another text console).
So, if I started the display manager by systemd, I would end up with a system that I couldn't fix. Therefore, until xorg.conf gets finished, I keep the default runlevel at 3 and start the graphics manually.
When xorg.conf gets to its final state, I'll tell systemd to start sddm automatically.

I'm new to Arch, even though I've been using linux since it was distributed on 3.5" floppies. However, I only usually update the system when I get a new machine.
Once it's stable, I don't much tweak it, as I make my living on it and the last thing I need is one toolset or another (some free, some commercial) becoming unusable due to lib changes and whatnot.

Offline

#21 2023-10-09 18:19:19

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 72,033

Re: Firefox is already running error message

So, if I started the display manager by systemd, I would end up with a system that I couldn't fix.

That's completely unrelated, run "systemctl start sddm" or limit the boot to the multi-user.target by default and explicitly isolate the graphical.target (2nd link below)

Offline

Board footer

Powered by FluxBB