QT app start up via systemd

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

QT app start up via systemd

696 Views
tanyagroysberg
Contributor I

I'm trying to start up QT application via systemd after boot the  systemctl status app_startup.service output is:

 app_startup.service - Qt App
   Loaded: loaded (/lib/systemd/system/app_startup.service; enabled; vendor pre>
   Active: failed (Result: exit-code) since Mon 2020-01-13 13:44:17 UTC; 14s ago
  Process: 510 ExecStart=/home/root/kria-cluster-2d-demo/kria_run.sh (code=exit>
 Main PID: 510 (code=exited, status=1/FAILURE)

Jan 13 13:44:17 imx8qm-var-som systemd[1]: Started Qt App.
Jan 13 13:44:17 imx8qm-var-som kria_run.sh[510]: Tanya !!!!!!!!!!!!!!!!!!!!!!!!>
Jan 13 13:44:17 imx8qm-var-som kria_run.sh[510]: Failed to create display (No s>
Jan 13 13:44:17 imx8qm-var-som systemd[1]: app_startup.service: Main process ex>
Jan 13 13:44:17 imx8qm-var-som systemd[1]: app_startup.service: Failed with res


But running manually the "systemctl  start app_startup" cmd it runs perfectly: 
root@imx8qm-var-som:~#  systemctl status app_startup.service
● app_startup.service - Qt App
   Loaded: loaded (/lib/systemd/system/app_startup.service; enabled; vendor pre>
   Active: active (running) since Mon 2020-01-13 13:49:12 UTC; 3s ago
 Main PID: 625 (kria_run.sh)
    Tasks: 6 (limit: 3296)
   CGroup: /system.slice/app_startup.service
           ├─625 /bin/sh /home/root/kria-cluster-2d-demo/kria_run.sh
           └─626 ./kria-cluster-2d-demo -platform wayland-egl

Jan 13 13:49:12 imx8qm-var-som systemd[1]: Started Qt App.
Jan 13 13:49:12 imx8qm-var-som kria_run.sh[625]: Tanya !!!!!!!!!!!!!!!!!!!!!!!!>
Jan 13 13:49:13 imx8qm-var-som kria_run.sh[625]: Using Wayland-EGL
Jan 13 13:49:13 imx8qm-var-som kria_run.sh[625]: FT_New_Face failed with index >
Jan 13 13:49:13 imx8qm-var-som kria_run.sh[625]: Using the 'xdg-shell-v6' shell>


Do you have any idea maybe I'm missing some environment definitions?
The .service and run script are attached.

Thanks you in advance, Tanya

0 Kudos
1 Reply

635 Views
jamesbone
NXP TechSupport
NXP TechSupport

I think the issue it is related to permissions since when you are running the command you are ROOT, and when you are using the script your are a local user.

0 Kudos