AnsweredAssumed Answered

How to write systemed .service file to automatically start Qt application?

Question asked by Takashi Kashiwagi on Mar 4, 2020
Latest reply on Mar 10, 2020 by Alexandr Gubanov

Hi Community.

 

I write .service as below but the Qt application does not start. 

 

[Unit]
Description=Test Qt Application
After=multi-user.target local-fs.target weston.service

[Service]
User=root
Restart=no
Type=simple
EnvironmentFile=/opt/test/root_env
ExecStart=/opt/test/app.sh
StandardOutput=journal+console

[Install]
WantedBy=multi-user.target weston.service

I want to start the QtApplication after weston.service starts. Is there anything wrong with it?

(When I checked dmesg, the service started before the western compositer.)

 

When I enter "systemctl start" after login, it will start normally.

 

/opt/test/app.sh is as follows.

#!/bin/sh
/opt/test/qtapp
exit 0

 

Qt Application log is as follows. "app.sh" is work. But QtAppliction is not work. 

QML debugging is enabled. Only use this in a safe environment.
Failed to create wl_display (No s
uch file or directory)
qt.qpa.plugin: Could not load the
Qt platform plugin "wayland" in "" even though it was found. because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: minimal, offscreen, vnc, wayland-egl, wayland.

 

Best Regards,

T.Kashiwagi

Outcomes