Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Application cannot be autorun during startup on raspberry with systemd
Qt 6.11 is out! See what's new in the release blog

Application cannot be autorun during startup on raspberry with systemd

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
2 Posts 2 Posters 651 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Benedek Talos
    wrote on last edited by
    #1

    Hi Together,

    I am trying to automatically run a QGuiApplication on a raspberry pi 4 running raspbian with systemd.
    The problem is, that the application is not starting automatically during startup, but if I trigger it manually with systemd (systemctl start <appname>), it starts properly, and the service is up and running.

    Here is my .service file:

    [Unit]
    Description=Qt application autostart
    
    [Service]
    Type=simple
    User=pi
    Environment="DISPLAY=:0"
    WorkingDirectory=/home/pi/Desktop/new_HMI_version_b_r/build
    ExecStart=/home/pi/Desktop/new_HMI_version_b_r/build/BB_HMI_prototype
    
    [Install]
    WantedBy=graphical.target
    

    Questions:

    • I left "Wanted by =" attribute open, as my understanding is, it lists dependents, which shalll be executed after my application is started, and since i dont have any dependents for now, its OK to ignore it. Correct?

    • I gave "WorkingDirectory=" the build folder of the application. I thinks its OK, but I have seen many examples on the internet that gave some system folder of the Pi... Shall something else be here?

    • What shall I put to attribute "WantedBy="? I think its the safest to give a dependency that my application launches as the last one triggered by systemd, so that every possible dependency is ready by then. Can I somehow explicitly force it to be started last by systemd?

    Thank you for the answers in advance!

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      This thread and some others on this forum are about the same subject.

      You may find there some information to get you going.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved