It ain't exactly flashy, but here's an alternative to
QtServiceif anyone would like to make use of it (Qt 5.5 compatible).
(Copy from the readme)
There are two exposed classes
QDaemonApplicationis derived from
QCoreApplicationand provides the basic infrastructure for the daemon.
QDaemonApplicationexposes 5 signals:
daemonized()- emitted when the application is started as a daemon/service by the OS and notifies the user that initializations (like connecting signals/slots) can be done.
started()- emitted when the application is run as a controlling terminal, notifying the user that the daemon/servicehas started.
stopped()- emitted when the application is run as a controlling terminal, notifying the user that the daemon/service has stopped.
installed()- emitted when the application is run as a controlling terminal, notifying the user that the daemon/service has been installed.
uninstalled()- emitted when the application is run as a controlling terminal, notifying the user that the daemon/service been uninstalled.
QDaemonLogis the logging component for the daemon. It's set up to output on
stdoutwhen the application is run as controlling terminal, and to a file (named after the application with .log extension) when the application is ran as daemon/service.
The logging component can be used by the user through
QDaemonLog & qDaemonLog();coupled with
QDaemonLog & << (const QString &)or
void qDaemonLog(const QString &, QDaemonLog::EntrySeverity). Currently the format of the output messages is fixed.
If you decide to use and find any bugs, please report them in the repo.
the_ last edited by
This sounds good. Thanks for sharing this code
It seems I'm replying to myself, but I just wanted to let you know that after some (internal) refactoring. The library now supports command line arguments to be passed to the daemon/service as well (specified on
--fake). However the library now requires Qt 5.6.
Hamed.Masafi last edited by
Great. I went looking for something like this. Thanks for sharing.
A Question. Is this library stable? If not, when stable version will be released?
Is this library stable? If not, when stable version will be released?
It depends on what you mean by stable.
If you mean the API, then probably you can safely say it's stable. I don't plan any (big) changes in the API. As for the binaries, it is binary compatible.
If you mean performance, I suppose it's stable enough. I have a project deployed with it and hadn't had any problems yet. Also it was reported by @madababi that the library works fine on Raspberry PI (with proper cross-compiling of course). There's always the possibility of minor bugs, but it should be fully functional.
Note There's currently no support for OSX.
moretromain last edited by moretromain
This post is deleted!
Konstantin Fomin last edited by
I am not very strong in English.
I would like to talk about your library.
Can we chat somewhere else?
Facebook? or somewhere else?