添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Part Number: SK-AM62

1、 led is my Qt application, affter SK-AM62 power on and wayland is readyed, run it via " root@am62xx-evm:~# ./led ", is OK is OK and led can run nomal.

2、now I want run led via systemd service, my material and script files are as follows:

root@am62xx-evm:~#
root@am62xx-evm:~# ls
hmi.sh led
root@am62xx-evm:~# cat hmi.sh
#!/bin/sh
export XDG_RUNTIME_DIR=/run/user/0
export QT_QPA_PLATFORM=wayland
/home/root/led
root@am62xx-evm:~#

my systemd service file is as follows:

root@am62xx-evm:~#
root@am62xx-evm:~# ls /lib/systemd/system/hmi.service
/lib/systemd/system/hmi.service
root@am62xx-evm:~#
root@am62xx-evm:~# cat /lib/systemd/system/hmi.service
[Unit]
Description=auto run hmi after psplash-quit service
After=weston.service

[Service]
Type=oneshot
ExecStart=/home/root/hmi.sh


[Install]
WantedBy=multi-user.target
root@am62xx-evm:~#

3、run result as follows:

root@am62xx-evm:~#
root@am62xx-evm:~# systemctl start hmi
[ 31.898129] kauditd_printk_skb: 1 callbacks suppressed
[ 31.898159] audit: type=1701 audit(37.884:17): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=880 comm="led" exe="/home/root/led" sig=6 res=1
[ 31.940162] audit: type=1334 audit(37.928:18): prog-id=13 op=LOAD
[ 31.946401] audit: type=1334 audit(37.936:19): prog-id=14 op=LOAD
Job for hmi.service failed because the control process exited with error code.
See "systemctl status hmi.service" and "journalctl -xeu hmi.service" for details.
root@am62xx-evm:~# [ 32.494895] audit: type=1334 audit(38.484:20): prog-id=14 op=UNLOAD
[ 32.502889] audit: type=1334 audit(38.484:21): prog-id=13 op=UNLOAD

root@am62xx-evm:~# systemctl status hmi.service
x hmi.service - auto run hmi after psplash-quit service
Loaded: loaded (/lib/systemd/system/hmi.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 1970-01-01 00:00:38 UTC; 10s ago
Process: 879 ExecStart=/home/root/hmi.sh (code=exited, status=134)
Main PID: 879 (code=exited, status=134)

Jan 01 00:00:37 am62xx-evm systemd[1]: Starting auto run hmi after psplash-quit service...
Jan 01 00:00:37 am62xx-evm hmi.sh[880]: Failed to create wl_display (No such file or directory)
Jan 01 00:00:37 am62xx-evm hmi.sh[880]: qt.qpa.plugin: Could not load the Qt platform plugin "wayland" in "" even though it was found.
Jan 01 00:00:37 am62xx-evm hmi.sh[880]: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Jan 01 00:00:37 am62xx-evm hmi.sh[880]: Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, xcb.
Jan 01 00:00:38 am62xx-evm hmi.sh[879]: /home/root/hmi.sh: line 4: 880 Aborted (core dumped) /home/root/led
Jan 01 00:00:38 am62xx-evm systemd[1]: hmi.service: Main process exited, code=exited, status=134/n/a
Jan 01 00:00:38 am62xx-evm systemd[1]: hmi.service: Failed with result 'exit-code'.
Jan 01 00:00:38 am62xx-evm systemd[1]: Failed to start auto run hmi after psplash-quit service.
root@am62xx-evm:~#

Can you tell me how to solve this probrom? Thank you!

Remove the following variables from your run script:

export XDG_RUNTIME_DIR=/run/user/0
export QT_QPA_PLATFORM=wayland

Regards,
Krunal

Please review the ti-apps-launcher.service. Essentially, you are missing the following in your recipe:

[Service]
# Requires systemd-notify.so Weston plugin.
Type=simple
Environment=XDG_RUNTIME_DIR=/run/user/1000
Environment=QT_QPA_PLATFORM=wayland
Environment=WAYLAND_DISPLAY=/run/wayland-0
EnvironmentFile=/etc/environment

Regards,
Krunal