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
解決済! 解決策の投稿を見る。
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
Please try to assign right $DISPLAY environment variable prior to start chromium.
I mean something like "export DISPLAY=:0"
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
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?