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. Auto start a Qt service on Linux

Auto start a Qt service on Linux

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 4.0k 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.
  • M Offline
    M Offline
    mikets
    wrote on last edited by
    #1

    I'm trying to figure out how QtService is supposed to work on Linux.
    As much as I see, installing a service just registers it in /etc/xdg/QtSoftware.conf and all queries like 'myservice -v' etc. go to this file for the information.

    However this fact does not cause the service to start up automatically on system reboot. Am I right?
    The closest thing I can think about is having a myservice.desktop file in /etc/xdg/autostart directory, but this should be done separately. And what if I want to start the computer on run level 3, without desktop ?

    Do I still need to add /etc/init.d script?

    If I do, what benefit do I get from QtSoftware.conf ? Just the ability to query status ?

    If I would design this system, I would have one universal "QtSoftware" service installed in /etc/init.d which goes over QtSoftware.conf and starts all services listed there.

    Is there something like this available ?

    Too many questions...

    1 Reply Last reply
    0
    • M Offline
      M Offline
      m_todorov
      wrote on last edited by
      #2

      I have the same problem.
      Any help?

      1 Reply Last reply
      0
      • David.GD Offline
        David.GD Offline
        David.G
        wrote on last edited by
        #3

        I'm not familiar with QtService in general, but if you are just trying to start a daemon (service) in linux, most modern linux distributions use systemd. (Ubuntu and its derivatives, Debian, OpenSUSE, Arch LInux, etc etc)

        I would suggest to immerse yourself with writing systemd unit files. You can run it at any run level as long as it's specified of course. You can also run it on all user profiles, this requires a bit more research although as far as I know you just create another unit file for them in /usr/lib/systemd/user/.

        http://www.freedesktop.org/software/systemd/man/systemd.service.html#Examples

        If it's a graphical interface you could familiarize yourself with XDG Autostart desktop files. All depends on the use case. Systemd provides a plethora of options, but it's slightly complex and requires plenty reading (depending on your use case). XDG autostart desktop file are incredibly simple to write.

        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