Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5186

Troubleshooting • Re: Can Open Browser from Terminal but Not from Systemd Service

$
0
0
Slight progress perhaps - by defining the user in the Service the root complaint is gone

Code:

[Unit]Description=Launch Chromium and MaD Status PageAfter=mad-start.service[Service]User=madWorkingDirectory=/home/madExecStart=/home/mad/./mad-page.sh[Install]WantedBy=multi-user.target
and a different set of errors are generated.

For X11 setup

Code:

Apr 19 18:18:23 MaDPi5 systemd[1]: Started mad-page.service - Launch Chromium and MaD Status Page.Apr 19 18:18:28 MaDPi5 mad-page.sh[2453]: [2453:2453:0419/181828.847253:ERROR:ozone_platform_x11.cc(243)] Missing X server or $DISP>Apr 19 18:18:28 MaDPi5 mad-page.sh[2453]: [2453:2453:0419/181828.847328:ERROR:env.cc(257)] The platform failed to initialize.  Exit>
and for Wayland

Code:

Apr 19 17:45:31 MaDPi5 systemd[1]: Started mad-page.service - Launch Chromium and MaD Status Page.Apr 19 17:45:37 MaDPi5 mad-page.sh[3334]: [3334:3334:0419/174537.155328:ERROR:ozone_platform_x11.cc(243)] Missing X server or $DIS>Apr 19 17:45:37 MaDPi5 mad-page.sh[3334]: [3334:3334:0419/174537.155402:ERROR:env.cc(257)] The platform failed to initialize.  Exi>
the errors appear to be the same.

As a sanity check, running the mad-page.sh

Code:

#!/bin/bashsleep 5chromium-browser --start-fullscreen http://localhost:5000/status
from the command line successfully launches chromium and loads the page.

Code:

mad@MaDPi5:~ $ ./mad-page.sh
Presumably there are some differences in the environment? between systemd and the user command line that allow the later to work.

Statistics: Posted by slonold — Fri Apr 19, 2024 10:59 pm



Viewing all articles
Browse latest Browse all 5186

Trending Articles