Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

How to run qtdbus application as systemd?



  • Nice to meet you.

    I made an application (car<-> controller) that communicates using qtdbus provided by Qt. see. https://doc.qt.io/qt-5/qtdbus-remotecontrolledcar-example.html

    Fortunately, I was able to verify that the application's communication was working fine.

    But when I use systemd to run the application automatically at system boot, I have a problem with no communication.

    Below are the services I wrote.

    Controller systemd service

    [Unit]
    Description=Controller App execution
    ConditionPathExists=/var/run/user/root/wayland-0

    [Service]
    Type=dbus
    BusName=org.example.CarExample.service
    EnvironmentFile=/etc/sysconfig/weston
    ExecStart=/home/root/controller_app
    WorkingDirectory=/home/root/

    [Install]
    WantedBy=multi-user.target
    Car systemd service
    [Unit]
    Description=Car app execution
    ConditionPathExists=/var/run/user/root/wayland-0

    Car systemd service

    [Service]
    Type=dbus
    BusName=org.example.CarExample.service
    EnvironmentFile=/etc/sysconfig/weston
    ExecStart=/home/root/car_app
    WorkingDirectory=/home/root/qt_demo

    [Install]
    WantedBy=multi-user.target
    my qdbus service

    my dbus service

    [D-BUS Service]
    Name=org.example.CarExample.service
    Exec=/usr/bin/dsw_camera_demo
    My purpose is to make the two applications using qdbus work fine when the system boots through systemd.

    It seems you are approaching the wrong way now.

    What more should I look for?


  • Lifetime Qt Champion

    @Tyler_J said in How to run qtdbus application as systemd?:

    What more should I look for?

    What is the status of the services? Are they running (see "systemctl status SERVICE")?
    Also you should not keep your executable in root home directory.



  • Thanks, guy.

    I found the answer.

    I think, problem was to implement the service in the system area.

    It has been found that qtbus communicates in the user area.

    Therefore, if a service is created in the user area of systemd, it can be confirmed that it operates normally without connection to the dbus service.


Log in to reply