[Mono-list] mono-service doesn't start my service - no errors

jcmag jcmag at yahoo.com
Sun Jan 21 11:40:28 EST 2007


>> but my service doesn't seem to start. I have no error messages, except:
>> Jan 20 21:17:47 mylaptop mono: MyHal.Service.exe: Log file already exists:
>> /tmp/MyHal.Service.exe.lock
>
>Try using /usr/bin/mono/usr/lib/mono/1.0/mono-service.exe
>MyHal.Service.exe on a command line and see if there are any messages.

Same thing, no messages.

But I've found that the call to log4net.Config.XmlConfigurator.ConfigureAndWatch stops the programs.
I've changed my Main method to:

            try
            {
                error("Main1", "Begin");

                 log4net.Config.XmlConfigurator.Configure(new FileInfo(System.IO.Path.GetFullPath("log4net.config")));
                error("Main1", "Begin2");
                ServiceBase.Run(new ServiceBase[] { new MyHal.Service.Service1() });
                error("Main1", "End");
            }
            catch(Exception exc)
            {
                error("Main exception", exc.ToString());
            }

Here I see in syslog the firt message ("Begin"). If I put in comment the log4net call I see "Begin2" method ; but then I think that the "MyHal.Engine.Core.Instance.Init();"  in the OnStart method does nothing... (the Core class has a static ctor with an error message that is never displayed)
It's rather hard to debug what mono-service does.... or doesn't... 

JC 

-------------------- 
http://sourceforge.net/projects/myhal

----- Original Message ----
From: Jörg Rosenkranz <joerg.rosenkranz at gmail.com>
To: jcmag <jcmag at yahoo.com>
Sent: Sunday, January 21, 2007 4:33:25 PM
Subject: Re: [Mono-list] mono-service doesn't start my service - no errors

Hi JC,

> but my service doesn't seem to start. I have no error messages, except:
> Jan 20 21:17:47 mylaptop mono: MyHal.Service.exe: Log file already exists:
> /tmp/MyHal.Service.exe.lock

Try using /usr/bin/mono/usr/lib/mono/1.0/mono-service.exe
MyHal.Service.exe on a command line and see if there are any messages.

> I've also another question: after the call to mono-service, the service is
> installed on the machine and will be executed, or do we have to do something
> for that?

mono-service is only a tool to run your service. You have to provide a
startup script for your specific distribution to run the service.

HTH,
Joerg.







 
____________________________________________________________________________________
It's here! Your new message!  
Get new email alerts with the free Yahoo! Toolbar.
http://tools.search.yahoo.com/toolbar/features/mail/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20070121/5864901d/attachment.html 


More information about the Mono-list mailing list