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