Auto start application on boot up

Hi, I want my application to run automatically upon boot up. I followed the instructions on How to Autorun Application at the Start up in Linux | Toradex Developer Center

When I tried the above resolution, I got “bad-setting (Reason: Unit .service has a bad unit file setting)” error. The post is more than 7 years old. How do I make my application to start automatically on boot up? The application is stored at /opt/Phoenix/bin/Phoenix on my target device.

Hardware: Boot2Qt 6.2.1 Toradex Verdin-iMX8MP

Operating System Information:
ID=b2qt
NAME=“Boot to Qt for Embedded Linux”
VERSION=“3.3.3 (hardknott)”
VERSION_ID=3.3.3
PRETTY_NAME=“Boot to Qt for Embedded Linux 3.3.3 (hardknott)”

Hi @Subbu,

Can you please share your .service file with us?

Does the same happen with one of our Toradex reference images?

Best Regards,
Hiago.

Attached the .service file. The screen shot shows the error I encountered. I have now (since I submitted the query) edited an existing b2qt.service file instead of creating my own .service file. That is why you dont see the bad-setting error anymore. I am using “b2qt-embedded-qt6-image-verdin-imx8mp.tezi.tar” given by toradex .

b2qt.service (278 Bytes)

Hi @Subbu,

Glad to know you managed to solve it somehow.

From the file you shared, apparently, the difference is the following line, am I correct?

After=systemd-user-sessions.service

Checking the Linux Kernel Manual (systemd-user-sessions.service(8) - Linux manual page), it appears for QT your service must be run after “basic system initialization is complete”.

Let me know if you need anything else. If you think you were able to solve this ticket, please mark your above reply as “solved”.

Best Regards,
Hiago.