Hi List,

How does one run a Mono app. as a deamon?

In C/C++ I would do it this way:

pid_t   pid, sid;

/* Fork off the parent process */
pid = fork();
if (pid < 0) {
    exit(EXIT_FAILURE);
}
/* If we got a good PID, then
   we can exit the parent process. */
if (pid > 0) {
    exit(EXIT_SUCCESS);
}
/* Create a new SID for the child process */
sid = setsid();

Hilsen/Regards
Michael Rasmussen

Get my public GnuPG keys:
michael  rasmussen  cc
http://keyserver.veridis.com:11371/pks/lookup?op=get&search=0xD3C9A00E
mir  datanom  net
http://keyserver.veridis.com:11371/pks/lookup?op=get&search=0xE501F51C
mir  miras  org
http://keyserver.veridis.com:11371/pks/lookup?op=get&search=0xE3E80917
--------------------------------------------------------------
There is no distinctly native American criminal class except Congress.
-- Mark Twain


Attachment: signature.asc
Description: Dette er en digitalt underskrevet brevdel

Reply via email to