Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Starting QT app as a Systemd service (another)
Forum Update on Monday, May 27th 2025

Starting QT app as a Systemd service (another)

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 3 Posters 1.2k Views
  • 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.
  • Y Offline
    Y Offline
    Yifan 0
    wrote on last edited by
    #1

    hi guys. i have a problem very samilar to this link text, the difference of which is i use wayland rather than x server. And i alse found another post link text from toradex.

    root@apalis-imx8:~# cat /lib/systemd/system/wayland-app-launch.service
    [Unit]
    Description=Start a wayland application
    After=weston@root.service    # ==> weston@.service
    Requires=weston@root.service # ==>weston@.service
    
    [Service]
    Restart=on-failure
    Type=forking
    Environment="QT_QPA_PLATFORM=wayland-egl"
    ExecStart=/usr/bin/qt-app
    RestartSec=1
    
    [Install]
    WantedBy=multi-user.target
    

    here is my weston service configure & my service
    6b9a3c92-bd24-4b61-8bc2-bcbd06d35d78-image.png

    so i replace it
    ac32a355-5101-4ca5-8fb8-1ed4d40db683-image.png

    then i daemon-reload and start 2110.service. something unfortunate happened!Is the dependency wrong?
    d43fdbe7-1587-470d-b3b6-18291768a0e8-image.png

    SGaistS 1 Reply Last reply
    0
    • Y Yifan 0

      hi guys. i have a problem very samilar to this link text, the difference of which is i use wayland rather than x server. And i alse found another post link text from toradex.

      root@apalis-imx8:~# cat /lib/systemd/system/wayland-app-launch.service
      [Unit]
      Description=Start a wayland application
      After=weston@root.service    # ==> weston@.service
      Requires=weston@root.service # ==>weston@.service
      
      [Service]
      Restart=on-failure
      Type=forking
      Environment="QT_QPA_PLATFORM=wayland-egl"
      ExecStart=/usr/bin/qt-app
      RestartSec=1
      
      [Install]
      WantedBy=multi-user.target
      

      here is my weston service configure & my service
      6b9a3c92-bd24-4b61-8bc2-bcbd06d35d78-image.png

      so i replace it
      ac32a355-5101-4ca5-8fb8-1ed4d40db683-image.png

      then i daemon-reload and start 2110.service. something unfortunate happened!Is the dependency wrong?
      d43fdbe7-1587-470d-b3b6-18291768a0e8-image.png

      SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Might be a silly question but did you check that you have that platform plugin available ?

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

      Y 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        Might be a silly question but did you check that you have that platform plugin available ?

        Y Offline
        Y Offline
        Yifan 0
        wrote on last edited by
        #3

        @SGaist i don't know which paltform plugin is. but if i run the /home/root/2110_12ECGLead_x8 directly, i worked and show ui normally

        1 Reply Last reply
        0
        • Y Offline
          Y Offline
          Yifan 0
          wrote on last edited by
          #4

          i also found the dependency service of my service, here is the info from journalctl
          a7d70b52-d347-4d09-aec1-db9034498128-image.png

          C 1 Reply Last reply
          0
          • Y Yifan 0

            i also found the dependency service of my service, here is the info from journalctl
            a7d70b52-d347-4d09-aec1-db9034498128-image.png

            C Offline
            C Offline
            ChrisW67
            wrote on last edited by
            #5

            @Yifan-0 The last line of your 2110.service file seems to have a typo

            Y 1 Reply Last reply
            0
            • Y Offline
              Y Offline
              Yifan 0
              wrote on last edited by
              #6

              somehow,it works well by adding :

              Environment="QT_QPA_PLATFORM=wayland"
              Environment="XDG_RUNTIME_DIR=/run/user/0"
              
              1 Reply Last reply
              1
              • Y Yifan 0 has marked this topic as solved on
              • C ChrisW67

                @Yifan-0 The last line of your 2110.service file seems to have a typo

                Y Offline
                Y Offline
                Yifan 0
                wrote on last edited by
                #7

                @ChrisW67 it is the terminal outputs overlaping ,the file's text itself not wrong, my fault!!

                1 Reply Last reply
                0

                • Login

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