poser
A C framework for POsix SERvices
Loading...
Searching...
No Matches
PSC_Daemon Class Reference

Run something as a daemon. More...

#include <poser/core/daemon.h>

Static Public Member Functions

int PSC_Daemon_run (PSC_Daemon_main dmain, void *data)
 Run as a daemon.
 
void PSC_Daemon_launched (void)
 Notify parent that the daemon successfully started.
 

Detailed Description

Run something as a daemon.

Member Function Documentation

◆ PSC_Daemon_launched()

void PSC_Daemon_launched ( void  )
static

Notify parent that the daemon successfully started.

When this is called from the running daemon, the parent process exits.

Note this is automatically called by PSC_Service_run() if needed.

◆ PSC_Daemon_run()

int PSC_Daemon_run ( PSC_Daemon_main  dmain,
void *  data 
)
static

Run as a daemon.

Runs a given function in a detached child process and optionally handles a pidfile. By default, it waits for successful startup of the daemon, passing through stderr output of the child. The behavior can be configured using PSC_Runopts.

Note this is automatically used by PSC_Service_run().

Parameters
dmainthe main function for the daemon
datadata to pass to the main function
Returns
an exit code

The documentation for this class was generated from the following file: