buildDaemon

The template holds a set of functions that build, run and send signals to daemons that are built with Daemon or DaemonClient template.

Truncated DaemonClient aren't able to run described daemon, only signal sending and daemon uninstalling.

Members

Classes

LoggedException
class LoggedException

Saves info about exception into daemon logger

Functions

run
int run(ILogger logger, string pidFilePath, string lockFilePath, int userId, int groupId)

Starts daemon that is described by DaemonInfo. Daemon is implemented as windows service and auto-installed in SC manager. If you want to uninstall the service, you can use uninstall function or system call:

sendSignal
void sendSignal(ILogger logger, Signal sig, string pidFilePath)

Sends singal sig for described daemon. All signals are sent via ControlService WINAPI function.

sendSignalDynamic
void sendSignalDynamic(ILogger logger, string serviceName, Signal sig, string pidFilePath)

ditto with dynamic service name

uninstall
void uninstall(ILogger logger)

Utility function that helps to uninstall the service from the system.

Meta