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. QProcess VS Qt-Solutions for daemon-service app
QtWS25 Last Chance

QProcess VS Qt-Solutions for daemon-service app

Scheduled Pinned Locked Moved Solved General and Desktop
qprocessdaemonservicelinuxwindows desktop
7 Posts 3 Posters 4.5k 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.
  • A Offline
    A Offline
    ainu
    wrote on 25 Oct 2017, 18:28 last edited by
    #1

    Hi, i looked through some resources and examples but it is still unclear for me if i have to use QProcess or Qt-Solutions in case i want to build daemon/service app ( for Linux/Windows respectively ). Could anybody clearify this please?

    Thank you in advance

    K 1 Reply Last reply 25 Oct 2017, 18:58
    0
    • A ainu
      25 Oct 2017, 18:28

      Hi, i looked through some resources and examples but it is still unclear for me if i have to use QProcess or Qt-Solutions in case i want to build daemon/service app ( for Linux/Windows respectively ). Could anybody clearify this please?

      Thank you in advance

      K Offline
      K Offline
      kshegunov
      Moderators
      wrote on 25 Oct 2017, 18:58 last edited by
      #2

      I don't see how QProcess would help you to build a daemon, you could use QtService or if you want to try it out QtDaemon (by myself and SGaist). The latter has a branch to be merged but I have been far too busy to do it.

      Read and abide by the Qt Code of Conduct

      A 1 Reply Last reply 25 Oct 2017, 19:07
      2
      • K kshegunov
        25 Oct 2017, 18:58

        I don't see how QProcess would help you to build a daemon, you could use QtService or if you want to try it out QtDaemon (by myself and SGaist). The latter has a branch to be merged but I have been far too busy to do it.

        A Offline
        A Offline
        ainu
        wrote on 25 Oct 2017, 19:07 last edited by ainu
        #3

        @kshegunov thank you for yout help)

        1 Reply Last reply
        0
        • J Offline
          J Offline
          jeremy_k
          wrote on 25 Oct 2017, 19:10 last edited by
          #4

          QProcess::startDetached allows you to start a program as a detached process that can outlive the parent process. It doesn't do anything to help create that program.

          I'm presuming you're referring to the Qt Solutions service component, which provides facilities for creating and managing the execution of a service.

          Asking a question about code? http://eel.is/iso-c++/testcase/

          A 1 Reply Last reply 25 Oct 2017, 20:13
          1
          • J jeremy_k
            25 Oct 2017, 19:10

            QProcess::startDetached allows you to start a program as a detached process that can outlive the parent process. It doesn't do anything to help create that program.

            I'm presuming you're referring to the Qt Solutions service component, which provides facilities for creating and managing the execution of a service.

            A Offline
            A Offline
            ainu
            wrote on 25 Oct 2017, 20:13 last edited by
            #5

            @jeremy_k thank you for your answer. This QProcess ability of detaching processes made me believe ( and seems falsely ) that i can create a daemon/service with it. But what did you mean by the phrase "it doesn't do anything to help create that program?"

            and i still have question about this phrase from qt man "Unix: The started process will run in its own session and act like a daemon." Does this phrase mean that the new detached process is a daemon on Unix systems but it can't act as a service on Windows? and so i'd better put my eyes on Qt Solutons service component?

            Thank you for your help

            K 1 Reply Last reply 25 Oct 2017, 20:15
            0
            • A ainu
              25 Oct 2017, 20:13

              @jeremy_k thank you for your answer. This QProcess ability of detaching processes made me believe ( and seems falsely ) that i can create a daemon/service with it. But what did you mean by the phrase "it doesn't do anything to help create that program?"

              and i still have question about this phrase from qt man "Unix: The started process will run in its own session and act like a daemon." Does this phrase mean that the new detached process is a daemon on Unix systems but it can't act as a service on Windows? and so i'd better put my eyes on Qt Solutons service component?

              Thank you for your help

              K Offline
              K Offline
              kshegunov
              Moderators
              wrote on 25 Oct 2017, 20:15 last edited by
              #6

              @ainu said in QProcess VS Qt-Solutions for daemon-service app:

              Does this phrase mean that the new detached process is a daemon on Unix systems but it can't act as a service on Windows?

              Not exactly no. On *nix systems one needs to detach from the terminal when making a daemon (which is what I do in the QtDaemon module) on windows there's a specific API for services that works differently. That's why it's best you choose one of the proposed 2 solutions.

              Read and abide by the Qt Code of Conduct

              A 1 Reply Last reply 25 Oct 2017, 20:30
              2
              • K kshegunov
                25 Oct 2017, 20:15

                @ainu said in QProcess VS Qt-Solutions for daemon-service app:

                Does this phrase mean that the new detached process is a daemon on Unix systems but it can't act as a service on Windows?

                Not exactly no. On *nix systems one needs to detach from the terminal when making a daemon (which is what I do in the QtDaemon module) on windows there's a specific API for services that works differently. That's why it's best you choose one of the proposed 2 solutions.

                A Offline
                A Offline
                ainu
                wrote on 25 Oct 2017, 20:30 last edited by
                #7

                @kshegunov I see, now i understand. Thank you for your help and for your patience.

                1 Reply Last reply
                0

                1/7

                25 Oct 2017, 18:28

                • Login

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