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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
2,087 次查看
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 项奖励
回复
1 解答
2,046 次查看
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

 

 

 

 

在原帖中查看解决方案

标记 (1)
0 项奖励
回复
3 回复数
2,060 次查看
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 项奖励
回复
2,047 次查看
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

 

 

 

 

标记 (1)
0 项奖励
回复
2,070 次查看
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 项奖励
回复