Can't run Firefox in headless mode as www-data user
Hi everyone,
I'm trying to run firefox in headless mode (for use with selenium) as the www-data user but it doesn't appear that firefox gets fully launched. There are no obvious errors but the correct processes don't appear to spawn either.
System: Ubuntu Server 20.04.2
Firefox 86
Here is what a successful run as a regular user looks like:
===
> firefox --headless
*** You are running in headless mode.
[GFX1-]: glxtest: Unable to open a connection to the X server
[GFX1-]: glxtest: libEGL initialize failed
(/usr/lib/
(/usr/lib/
(/usr/lib/
(/usr/lib/
^CExiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
===
Here is the output of ps during the run:
===
glenn 757284 173736 45 08:37 pts/2 00:00:06 /usr/lib/
glenn 757337 757284 15 08:37 pts/2 00:00:02 /usr/lib/
glenn 757404 757284 3 08:37 pts/2 00:00:00 /usr/lib/
glenn 757434 757284 6 08:37 pts/2 00:00:00 /usr/lib/
glenn 757497 757284 3 08:37 pts/2 00:00:00 /usr/lib/
===
Note the multiple child processes created.
Here is the same when running as www-data:
===
# sudo -u www-data firefox --headless
*** You are running in headless mode.
[GFX1-]: glxtest: Unable to open a connection to the X server
[GFX1-]: glxtest: libEGL initialize failed
^C
===
And ps:
===
root 757844 357685 0 08:38 pts/3 00:00:00 sudo -u www-data firefox --headless
www-data 757849 757844 2 08:38 pts/3 00:00:00 /usr/lib/
===
I don't think this is a firefox issue. I tried the same on an openSUSE server using the wwwrun user which spawned the child processes fine.
There is some restriction on Ubuntu but no mention of anything in the journal logs during the run attempts.
Any suggestions on how to deal with this would be greatly appreciated!
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Ubuntu Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Manfred Hampl
- Solved:
- Last query:
- Last reply: