runTerminal

Run application as casual process (attached to tty) with progMain main function and passes args into it. If daemon catches SIGHUP signal, listener delegate is called (available on linux only).

If application receives some kind of terminating signal, the termListener is called. termListener should end progMain to be able to clearly shutdown the application.

If application receives "real-time" signal SIGROTATE defined as SIGRTMIN+10, then rotateListener is called to handle 'logrotate' utility.

Daemon writes log message into provided logger.

groupid and userid are used to low privileges with run as root.

int
runTerminal
(
shared ILogger logger
,
int delegate
(
string[]
)
progMain
,
string[] args
,
void delegate
()
listener
,
void delegate
()
termListener
,
void delegate
()
rotateListener
,
int groupid = -1
,
int userid = -1
)

Meta