Title: Nachricht
Hi all,
 
I suppose you are missing the ServiceBase.Run call in your Main method:
 
 System.ServiceProcess.ServiceBase[] servicesToRun;
 servicesToRun = new System.ServiceProcess.ServiceBase[] { new TestService("TestService1")};
 System.ServiceProcess.ServiceBase.Run(servicesToRun);
 
This method then calls your OnStart function.
I have attached a sample service I made some time ago as bug test case. Maybe this is helpfull for you.
 
Another idea: mono-service logs errors into syslog. Did you look into /var/log/messages?
 
Joerg.
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bradley, Peter
Sent: Tuesday, November 01, 2005 11:08 AM
To: WILSON LEI; mono-list@lists.ximian.com
Subject: RE: [Mono-list] mono-service

Could I take the opportunity to add my voice to this?  I was intending to post something similar when I’d done a bit more work on the topic, but Wilson has beaten me to it.

 

The mono-service man pages are very sparse.  If I can get it working, I’d be very happy to write it up as a How-To sort of document for others.

 

Thanks

 

 

Peter

 


From: WILSON LEI [mailto:[EMAIL PROTECTED]
Sent: 31 October 2005 13:44
To: mono-list@lists.ximian.com
Subject: [Mono-list] mono-service

 

Hi,

 

I am trying to port a windows service project to Linux (SuSE 10 Desktop). The project compiles fine and I have an EXE. I then add mono-service myservice.exe into my startup script, however, the service is not started. I got an error saying "Exec format error". Could someone help me on this?

 

I also complied a simplest service and tried to run it on Linux using mono-service, I saw the Main() was called but the OnStart() function is not. Could someone guide me how to make a service on Linux just like a daemon?

 

Thanks,

 

Wilson

Attachment: TestService.cs
Description: TestService.cs

_______________________________________________
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to