Service
The QtService component is useful for developing Windows services and Unix daemons.
The project provides a QtService template class that can be used to implement service applications, and a QtServiceController class to control a service.
On Windows systems the implementation uses the Service Control Manager.
On Unix systems services are implemented as daemons.
Required Libraries:
QtCore, QtNetwork (except on Windows)
Please refer to the Qt Editions Comparison Chart for which Qt products include these libraries.
Documentation:
Classes:Examples:Tested on:
- Qt 4.3, 4.4 / Windows XP, Vista / MSVC.NET 2005
- Qt 4.3, 4.4 / Linux / gcc
- Qt 4.3, 4.4 / MacOS X / gcc
Unsupported platforms:
Only the tested platforms are supported, however the classes should be platform independent and are likely to work on the platforms supported by Qt.
Download Commercial Edition:
Only available for Qt Solutions license holders with a valid Support and Maintenance agreement (authentication required).Changes:
- 2.5: Fixes: Improved logging of multi-line messages on Unix.
- 2.5: Fixes: crash on OS X Leopard. Note: On mac, main() will now be executed both in the starting process and in the forked, service process. This is consistent with the behaviour on Windows.
- 2.4: Windows: internal redesign of threading. Fixes issue where signal/slot connections created before start() would not work. Fixes problem/warning about QApplication not created in main thread.
- 2.4: Windows: Fix: GUI services would terminate on logoff.
- 2.4: Added doc about usage on Windows Vista
- 2.4: Added -w(ait) argument to controller example
- 2.4: Document the caveats of using GUI services, including that Vista does not support it.
- 2.4: Improved command-line help text.
- 2.4: Windows: Do net require Administrator privileges just to start service.
- 2.3: Compilation fixes for MinGW.
- 2.3: Windows: Place controller's receiver object in proper thread. (makes QtService work with Qt 4.2).
- 2.3: Unix: Using QProcess in a service no longer leaves zombie processes around.
- 2.2: Windows: Dependency on the QtGui library removed.
- 2.2: Unix: logMessage() works properly with '%' characters.
- 2.1: Windows: Send command IDs correctly.
- 2.1: Windows: Report status correcty when stopping through the controller.
- 2.1: Windows: Added account and password arguments to install().
- 2.1: Unix: Documentation about installing service improved.
- 2.1: More feedback while installing / uninstalling.
- 2.0: Reimplemented for Qt 4 with improved API.