[Mono-list] mono-service2 doesn't call OnStart

Adam Tauno Williams adam at morrison-ind.com
Sat Oct 25 15:00:47 EDT 2008

On Sat, 2008-10-25 at 13:53 -0400, Gonzalo Paniagua Javier wrote:
> On Sat, 2008-10-25 at 12:35 -0400, Adam Tauno Williams wrote:
> > I've create a fairly simple System.ServiceProcess.ServiceBase on what I
> > think is the correct manner.   But when I try to run it with
> > mono-service2 it seems as though nothing at all happens, not even any
> > error messages.
> > $ mono-service2 --no-daemon Whitemice.ZideNET.exe
> >  - or -
> > $ mono-service2 Whitemice.ZideNET.exe
> I have modified your test to log to a file (attached) and run it using
> mono-service2. The output I see in the file is:
> ---------
> Main
> Service ctor
> Service ctor complete
> Starting 1 services....
> Service OnStart
> ---------
> So the problem must be something else.

Yep,  your code on my box produces no log file at all when run with
mono-service2.   I added a hack to just run OnStart if there is a
"--no-daemon" option (rather than calling ServiceBase.Run), like -

mono Whitemice.ZideNET.exe --no-daemon

- and the service runs on the console, responds to requests, etc...  But
when run as "mono-service2 Whitemice.ZideNET.exe" absolutely nothing
happens.  For now I'll just run on the console.

More information about the Mono-list mailing list