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

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

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

ソリューションへジャンプ
1,810件の閲覧回数
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 解決策
1,769件の閲覧回数
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 返答(返信)
1,783件の閲覧回数
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 件の賞賛
返信
1,770件の閲覧回数
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 件の賞賛
返信
1,793件の閲覧回数
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 件の賞賛
返信