0

I am working on a yocto image based on the Kirkstone branch and want to include a Firefox Browser running on Wayland which autostarts at boot.

I have build an image including Firefox and a systemd service file to autostart it when my system boots (raspberry PI 4 Compute module with DSI touchscreen).

The system has a user=weston present which is autoconfigured in a yocto build when you build with wayland support.. This user also has the Wayland display. Furthermore I have one other configured user: user=service which I mainly use to debug.

What I try to do is to boot firefox via systemd using the following systemd file:

[Unit]
Description=Start a wayland application
After=weston.service
Requires=weston.service

[Service]
Type=simple
User=weston
Group=weston
PAMName=login
Environment=WAYLAND_DISPLAY=/run/user/1000/wayland-1
Environment=XDG_RUNTIME_DIR=/run/user/1000
Environment=MOZ_ENABLE_WAYLAND=1
ExecStart=/usr/bin/firefox

[Install]
WantedBy=graphical.target

However at boot the browser doesn't start and systemd reports a crash:

Jan 15 22:38:18 hometerminal-cm4 systemd[1]: Started Start a firefox browser.
-- Subject: A start job for unit firefox.service has finished successfully
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- A start job for unit firefox.service has finished successfully.
--
-- The job identifier is 1089.
Jan 15 22:38:21 hometerminal-cm4 systemd[1]: firefox.service: Main process exited, code=killed, status=11/SEGV
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- An ExecStart= process belonging to unit firefox.service has exited.
--
-- The process' exit code is 'killed' and its exit status is 11.
Jan 15 22:38:21 hometerminal-cm4 systemd[1]: firefox.service: Failed with result 'signal'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- The unit firefox.service has entered the 'failed' state with result 'signal'.

Which would state that I have a segv fault, I just don't understand why? I am guessing it has something to do with the environment in which the system runs.

I have made a similar systemd file for testing which I use to run weston-terminal at boot and that works fine. It is fully identical to the above except for the Execstart and the MOZ_ENABLE_WAYLAND=1 not being there.

How do you configure the environment for a firefox browser in such a way that it can autostart at boot?

7
  • 1
    The problem might be related to running Firefox as root. I think you should use a systemd user service or change User=root to your current user (create it if you only have the root user) Jan 8, 2023 at 18:11
  • You are correct, I have now reworked my image so that the root user is no longer present as seen in the edited original question.
    – Gerrit
    Jan 10, 2023 at 21:44
  • Show the output of: sudo journalctl -xeu your_service.service. That may show a more detailed log about the current error. Jan 12, 2023 at 1:38
  • I have added the output as requested.
    – Gerrit
    Jan 15, 2023 at 22:47
  • If you run the service directly: sudo systemctl start yourservice, do you have the same error? Jan 16, 2023 at 5:11

1 Answer 1

0

Finally I found the problem. There was an error somewhere in firefox which causes runtime segv error when running. Using the above systemd script but replacing firefox with chromium works like a charm.

You must log in to answer this question.

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