can not auto startup chromium(chromium-ozone-wayland)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

can not auto startup chromium(chromium-ozone-wayland)

Jump to solution
2,253 Views
gonewithwind-peter
Senior Contributor I

hi all,

I am playing imx8qm iwave board with yocto 5.4-zeus.

 I have added 

chromium.service  at /etc/systemd/system/chromium.service

and make a link at /etc/systemd/system/multi-user.target.wants/chromium.service

it can run ExecStart=/bin/touch /aa.txt 

after startup , I can find /aa.txt generated, it means the chromium.service running

but chromium not running.

anyway, I can manaully start up  chromium after log in

Why can not auto startup chromium ?

 

any help?

thank you.

 

chromium.service file:

[Unit]

Description=launch chromium

[Service]

Type=oneshot

ExecStart=/bin/touch /aa.txt

ExecStart=/bin/sleep 20

ExecStart=/usr/bin/chromium  --no-sandbox --gpu-no-context-lost --enable-gpu-rasterization --start-fullscreen --kiosk --no-first-run --incognito http://localhost:3300/rpi.html > /dev/null 2>&1 &

[Install]

WantedBy=multi-user.target

0 Kudos
Reply
1 Solution
2,212 Views
gonewithwind-peter
Senior Contributor I

Hi @b36401 

I have find the solution. it's hard to do in systemd(maybe it's new for me):

1. create environmen file chromium first:

cat /etc/default/chromium
#OPTARGS="--xwayland --use-g2d=1"

XDG_RUNTIME_DIR="/run/user/0"

2. create a chromium.service file at /etc/systemd/system/chromium.service , put in the environmen file   like following:

[Unit]
Description=launch chromium

[Service]
User=root

Type=oneshot

ExecStart=/bin/sleep 20

EnvironmentFile=-/etc/default/chromium
ExecStart=/usr/bin/chromium --no-sandbox --gpu-no-context-lost --enable-gpu-rasterization --start-fullscreen --kiosk --no-first-run --incognito http://localhost:3300/rpi.html > /dev/null 2>&1 &


[Install]
WantedBy=multi-user.target

 

3. run: systemctl enable chromium or

directly make a symbol link at :

/etc/systemd/system/multi-user.target.wants/chromium.service -> /etc/systemd/system/chromium.service

 

at  /etc/systemd/system/multi-user.target.wants/. to run ln -s  chromium.service  ../chromium.service  to make this link

 

.

try to run systemctl start chromium to test. works well.

power off and power on or restart . work well.

done

 

Thank you

 

 

 

 

View solution in original post

Tags (1)
0 Kudos
Reply
3 Replies
2,226 Views
b36401
NXP Employee
NXP Employee

Please try to assign right $DISPLAY environment variable prior to start chromium.
I mean something like "export DISPLAY=:0"

0 Kudos
Reply
2,213 Views
gonewithwind-peter
Senior Contributor I

Hi @b36401 

I have find the solution. it's hard to do in systemd(maybe it's new for me):

1. create environmen file chromium first:

cat /etc/default/chromium
#OPTARGS="--xwayland --use-g2d=1"

XDG_RUNTIME_DIR="/run/user/0"

2. create a chromium.service file at /etc/systemd/system/chromium.service , put in the environmen file   like following:

[Unit]
Description=launch chromium

[Service]
User=root

Type=oneshot

ExecStart=/bin/sleep 20

EnvironmentFile=-/etc/default/chromium
ExecStart=/usr/bin/chromium --no-sandbox --gpu-no-context-lost --enable-gpu-rasterization --start-fullscreen --kiosk --no-first-run --incognito http://localhost:3300/rpi.html > /dev/null 2>&1 &


[Install]
WantedBy=multi-user.target

 

3. run: systemctl enable chromium or

directly make a symbol link at :

/etc/systemd/system/multi-user.target.wants/chromium.service -> /etc/systemd/system/chromium.service

 

at  /etc/systemd/system/multi-user.target.wants/. to run ln -s  chromium.service  ../chromium.service  to make this link

 

.

try to run systemctl start chromium to test. works well.

power off and power on or restart . work well.

done

 

Thank you

 

 

 

 

Tags (1)
0 Kudos
Reply
2,236 Views
gonewithwind-peter
Senior Contributor I

I have found similar  answer at here,but I need to manually login to trigger the auto  start up. it still can not actually auto start up. 

any help?

0 Kudos
Reply