Qt app launched at startup of a Jetson Nano
-
Hi,
I made a Qt quick application (with Qt 5.15.2) that works well on a Jetson Card.
I now want to launch it automaticaly at startup, so I created a service to do that :[Unit] Description= Camera_quick autostart After=graphical.target [Service] Type=simple User=jetson WorkingDirectory=/home/jetson/Startup/Camera_quick ExecStart=/home/jetson/Startup/Camera_quick/Camera_quick [Install] WantedBy=multi-user.target
But this service is not able to run the app :
camera-quick.service - Camera_quick autostart Loaded: loaded (/lib/systemd/system/camera-quick.service; enabled; vendor preset: enabled) Active: failed (Result: core-dump) since Wed 2022-01-19 16:51:53 CET; 1min 18s ago Process: 7749 ExecStart=/home/jetson/Startup/Camera_quick/Camera_quick (code=dumped, signal=ABRT) Main PID: 7749 (code=dumped, signal=ABRT) Jan 19 16:51:47 jetson systemd[1]: Started Camera_quick autostart. Jan 19 16:51:52 jetson Camera_quick[7749]: qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. Jan 19 16:51:52 jetson Camera_quick[7749]: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Jan 19 16:51:52 jetson Camera_quick[7749]: Available platform plugins are: xcb. Jan 19 16:51:53 jetson systemd[1]: camera-quick.service: Main process exited, code=dumped, status=6/ABRT Jan 19 16:51:53 jetson systemd[1]: camera-quick.service: Failed with result 'core-dump'.
However, when I run "/home/jetson/Startup/Camera_quick/Camera_quick", the app is launched (so the plugin "xcb" is found!).
To summarize :
- launched by Qt : works
- launched by terminal : works
- launched by service : doesn't workAny ideas ?
Regards
-
Hi,
I made a Qt quick application (with Qt 5.15.2) that works well on a Jetson Card.
I now want to launch it automaticaly at startup, so I created a service to do that :[Unit] Description= Camera_quick autostart After=graphical.target [Service] Type=simple User=jetson WorkingDirectory=/home/jetson/Startup/Camera_quick ExecStart=/home/jetson/Startup/Camera_quick/Camera_quick [Install] WantedBy=multi-user.target
But this service is not able to run the app :
camera-quick.service - Camera_quick autostart Loaded: loaded (/lib/systemd/system/camera-quick.service; enabled; vendor preset: enabled) Active: failed (Result: core-dump) since Wed 2022-01-19 16:51:53 CET; 1min 18s ago Process: 7749 ExecStart=/home/jetson/Startup/Camera_quick/Camera_quick (code=dumped, signal=ABRT) Main PID: 7749 (code=dumped, signal=ABRT) Jan 19 16:51:47 jetson systemd[1]: Started Camera_quick autostart. Jan 19 16:51:52 jetson Camera_quick[7749]: qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. Jan 19 16:51:52 jetson Camera_quick[7749]: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Jan 19 16:51:52 jetson Camera_quick[7749]: Available platform plugins are: xcb. Jan 19 16:51:53 jetson systemd[1]: camera-quick.service: Main process exited, code=dumped, status=6/ABRT Jan 19 16:51:53 jetson systemd[1]: camera-quick.service: Failed with result 'core-dump'.
However, when I run "/home/jetson/Startup/Camera_quick/Camera_quick", the app is launched (so the plugin "xcb" is found!).
To summarize :
- launched by Qt : works
- launched by terminal : works
- launched by service : doesn't workAny ideas ?
Regards
-
Ok I changed the way of doing that :
I created a *.desktop file in .config/autostart[Desktop Entry] Path=/home/jetson/Startup/Camera_quick Exec=/bin/bash /home/jetson/Startup/Camera_quick/run.sh Type=Application
and the run.sh file is :
#!/bin/bash export LD_LIBRARY_PATH=/usr/local/Qt-5.15.2/lib/ /home/jetson/Startup/Camera_quick/Camera_quick
And that works !
Thanks