[Mono-list] Deamonize. Running a Mono app. in the background

Jörg Rosenkranz joergr@voelcker.com
Tue, 15 Mar 2005 15:24:20 +0100


Hello Michael,

> -----Original Message-----
> From: mono-list-admin@lists.ximian.com 
> [mailto:mono-list-admin@lists.ximian.com] On Behalf Of 
> Michael Rasmussen
> 
> Hi List,
> 
> How does one run a Mono app. as a deamon?
> 
> In C/C++ I would do it this way:
> 
> ...
> /* Fork off the parent process */
> pid = fork();

The standard Unix functions are implemented in namespace
Mono.Unix in assembly Mono.Posix, but the fork calls aren't 
working from managed code.

I have done a C daemon using Embedded Mono to run a
Windows Service implemented in .NET on Linux. I have 
sent a first proposal to Mono-Devel list some days ago:
http://article.gmane.org/gmane.comp.gnome.mono.devel/10777

You can take the attached daemon as starting point for 
your own implementation or help promoting the inclusion 
of something like that in Mono ;-)

Joerg.