Deskflow 1.22.0.197
Keyboard and mouse sharing utility
|
Unix implementation of IArchDaemon. More...
#include <ArchDaemonUnix.h>
Public Member Functions | |
ArchDaemonUnix ()=default | |
~ArchDaemonUnix () override=default | |
int | daemonize (const char *name, DaemonFunc const &func) override |
Daemonize the process. | |
Public Member Functions inherited from ArchDaemonNone | |
ArchDaemonNone ()=default | |
~ArchDaemonNone () override=default | |
void | installDaemon (const char *name, const char *description, const char *pathname, const char *commandLine, const char *dependencies) override |
Install daemon. | |
void | uninstallDaemon (const char *name) override |
Uninstall daemon. | |
bool | canInstallDaemon (const char *name) override |
Check if user has permission to install the daemon. | |
bool | isDaemonInstalled (const char *name) override |
Check if the daemon is installed. | |
void | installDaemon () override |
Install daemon. | |
void | uninstallDaemon () override |
Uninstall daemon. | |
std::string | commandLine () const override |
Get the command line. | |
Public Member Functions inherited from IArchDaemon | |
Public Member Functions inherited from IInterface | |
virtual | ~IInterface ()=default |
Interface destructor does nothing. |
Additional Inherited Members | |
Public Types inherited from IArchDaemon | |
using | DaemonFunc = std::function<int(int, const char **)> |
Unix implementation of IArchDaemon.
|
default |
|
overridedefault |
|
overridevirtual |
Daemonize the process.
Daemonize. Throw XArchDaemonFailed on error. name
is the name of the daemon. Once daemonized, func
is invoked and daemonize returns when and what it does.
Exactly what happens when daemonizing depends on the platform.
func
gets passed one argument, the name passed to daemonize(). func
is only called when the service is actually started. func
must call ArchMiscWindows::runDaemon()
to finally becoming a service. The runFunc
function passed to runDaemon()
must call ArchMiscWindows::daemonRunning(true)
when it enters the main loop (i.e. after initialization) and ArchMiscWindows::daemonRunning(false)
when it leaves the main loop. The stopFunc
function passed to runDaemon()
is called when the daemon must exit the main loop and it must cause runFunc
to return. func
should return what runDaemon()
returns. func
or runFunc
can call ArchMiscWindows::daemonFailed()
to indicate startup failure. Reimplemented from ArchDaemonNone.