Re: [Mono-list] mono-service for mkbundle'd apps?
On 20.04.2014 15:00, cocowalla wrote: I have a Windows service that I want to run with Mono on Linux. I can run it as a service using mono-service, and this works fine. I also want to mkbundle the application to ease deployment for end-users, so they don't need to faff about installing Mono themselves. What is the recommended way to run the resulting native binaries as a service on Linux? You may want to try to bundle mono-service.exe together with your service assemblies and provide a launcher script similar to mono-service. However, mkbundle was not designed for such (rather complex) use cases, so your mileage might vary. Robert ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] mono-service for mkbundle'd apps?
I'm afraid I'm rather uncertain about how that would work. Are you able to elaborate a bit? -- View this message in context: http://mono.1490590.n4.nabble.com/mono-service-for-mkbundle-d-apps-tp4662558p4662579.html Sent from the Mono - General mailing list archive at Nabble.com. ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] mono-service doesn't catch any signal
On 02.03.2011 10:51, cometeor wrote: I'm using mono-2.8.2 on debian (virtual machine by openvz). My test service: class Test : ServiceBase { static void Main() { ServiceBase.Run(new Test()); } static void Run() { while (!finished) { } } static bool finished = false; protected override void OnStart(string[] args) { Console.WriteLine(OnStart); You're not supposed to block inside OnStart: Run(); } Robert ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] mono-service doesn't catch any signal
thanks, it works fine now. -- View this message in context: http://mono.1490590.n4.nabble.com/mono-service-doesn-t-catch-any-signal-tp3331259p3331328.html Sent from the Mono - General mailing list archive at Nabble.com. ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Mono service works with --debug only
Hello, I use mono 1.2.6 and bash Thank you On Tue, May 27, 2008 at 1:20 AM, Daniel Nauck [EMAIL PROTECTED] wrote: Hello, what version of Mono are you using? Do you use the dash shell? I fixed a such a problem for Mono 1.9 on Ubuntu's dash shell: http://lists.ximian.com/pipermail/mono-patches/2008-January/108859.html Daniel Julien Sobrier schrieb: Hello, I have a mono service that works well when I launch it with the --debug argument: mono-service2 -l:/var/run/ptestt-lock /usr/lib64/test/Test.exe --debug But when I run it without the --debug argument, the lock file is not created, the service does not appear in ps -ef, and there is nothing in syslog. What can I do to debug the issue? Thank you Julien ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Mono service works with --debug only
Daniel Nauck wrote: Hello, what version of Mono are you using? Do you use the dash shell? I fixed a such a problem for Mono 1.9 on Ubuntu's dash shell: http://lists.ximian.com/pipermail/mono-patches/2008-January/108859.html Daniel Julien Sobrier schrieb: Hello, I have a mono service that works well when I launch it with the --debug argument: mono-service2 -l:/var/run/ptestt-lock /usr/lib64/test/Test.exe --debug But when I run it without the --debug argument, the lock file is not created, the service does not appear in ps -ef, and there is nothing in syslog. What can I do to debug the issue? Thank you Hello, it was actually a bug in the mono RPM from CentOS5. In mono=-service2: if $debug; then exec /usr/bin/mono $MONO_OPTIONS `/usr/bin/monodir`/2.0/mono-service.exe $arg s else exec /usr/bin/mono $MONO_OPTIONS `/usr/bin/monodir`/2.0/mono-service2.exe $ar gs /dev/null /dev/null fi Note that in debug, it references mono-service.exe, otherwiase it calls mono-service2.exe which does not exist. Thank you ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] mono-service, mono-service2
fevans wrote: This question is perhaps less about mono-service, and more about the .NET ServiceProcess. The benefits are auto-startup, restart on failure, logging, etc. Does hosting my application within a Windows Service (ServiceProcess) buy me anything else? Like thread handling, concurrent connections, or do I need to implement those myself? You have to implement all these features yourself. Within the context of mono under Linux, how does mono-service interact with the OS. In other words, how do I define the startup/authentication/logging for mono-service. Startup services are not part of mono-service. You must provide your own startup scripts. Search the list for samples, as this topic has been already discussed a couple of times. I realize the question is vague, so if anyone can provide a few links, or even key-words to google, I'd appreciate it. Thanks in advance. PROJECT DETAILS: I'm running a message-receiver on linux, which accepts an ant project and invokes it. With regards to the transport, I considered running an xsp/xsp web service. But some of the processes I'm running are massive, consume loads of cpu/memory and can take hours to run. I don't want to invoke them within a web-application, though if anyone disagrees with this concern I'll gladly stand corrected. Its the sort of thing that WCF is intended to handle, but that's not an option right now. At this point mono-service seems like the best option, but I'm not sure. I'd host those jobs inside their own XSP process (to decouple them from the web site [if any]) and access them via Web Services. Another approach is using a service + remoting for IPC. Robert ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] mono-service
Rob McMillen wrote: List, I have an exe being launched as a service via mono-service2. I was wondering if there is a way to pass arguments to the service when I start it with mono-service2. Unfortunately, mono-service does not pass any arguments to Main () or to OnStart (). Please file a bug under Tools at http://www.mono-project.com/Bugs Robert ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] mono-service
Hello, Jyoti Seth said the following on 28.03.2007 12:20: I want to run my window service on suse linux 10.0 SP1 system. I have read about mono-service on net with which it is possible. I have already installed mono on my system and my asp.net application is running . But I didn’t find mono-service anywhere on the system. Do I need to seperately install mono-service on my suse linux system. mono-service and mono-service2 are in mono-extras rpm. -- Oleg ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] mono-service doesn't start my service - no errors
On 01/21/07 Rafael Teixeira wrote: Recently a fix for static constructors not being automatically called, went into SVN, what looks like what you are telling. I think the fix affects the in the native part of the runtime. The fix is for _module_ static constructors, which is a feature not available in C# and hence highly unlikely to matter in this case. lupus -- - [EMAIL PROTECTED] debian/rules [EMAIL PROTECTED] Monkeys do it better ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] mono-service doesn't start my service - no errors
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 [EMAIL PROTECTED] To: jcmag [EMAIL PROTECTED] 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/___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] mono-service doesn't start my service - no errors
Recently a fix for static constructors not being automatically called, went into SVN, what looks like what you are telling. I think the fix affects the in the native part of the runtime. So, probably, you need to retest your case with a newer runtime compiled from SVN head. Hope it helps, Rafael Teixeira On Sun, 2007-01-21 at 08:40 -0800, jcmag wrote: 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 [EMAIL PROTECTED] To: jcmag [EMAIL PROTECTED] 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. __ Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends. __ E-mail classificado pelo Identificador de Spam Inteligente. Para alterar a categoria classificada, visite o Terra Mail __ Esta mensagem foi verificada pelo E-mail Protegido Terra. Scan engine: McAfee VirusScan / Atualizado em 19/01/2007 / Versão: 5.1.00/4943 Proteja o seu e-mail Terra: http://mail.terra.com.br/ ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
RE: [Mono-list] mono service/SCM on linux how to
There is some stuff here: http://www.peredur.uklinux.net/msc/ (in particular, pages 54, 55 and 56) It's not very much and is SuSE-based, but it is recent and does deal with cross-platform issues. HTH Peter -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Nate Chadwick Sent: 01 May 2006 19:51 To: Mono-list@lists.ximian.com Subject: [Mono-list] mono service/SCM on linux how to Hi, I have been trawling the list archives and the mono site on the recommended approach for writing / deploying a windows service to target linux but haven't been able to find a good reference. What is the current recommended approach for developing and deploying services with mono on linux? Basically I am looking to port a windows service so that it runs via /etc/init.d/natesnuclearservice start | stop | restart etc. I saw a few threads refer to a mono-service but they seemed a couple years old? Any pointers appreciated. Thanks, -n ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] mono service/SCM on linux how to
Hi Nate, I have been trawling the list archives and the mono site on the recommended approach for writing / deploying a windows service to target linux but haven't been able to find a good reference. The good reference depends pretty much on the Linux distribution you are targetting. Most documentation and links in the list archive are about Novell's SuSE Linux; I managed to get it working on Fedora Core (and Solaris) based on that, using documentation for native daemons/services. What is the current recommended approach for developing and deploying services with mono on linux? Basically I am looking to port a windows service so that it runs via /etc/init.d/natesnuclearservice start | stop | restart etc. Usually this involves having a distribution-specific shell script that spawns mono-service (or mono-service2 for .NET 2.0) and interacts with it via PID and signals. During initial development getting your service to work can be a little tricky as exceptions or Mono crashes are not logged. You might need to figure out how to manually call Mono with the managed mono-service class to see its output on the console. As for deployment, that depends on the system as well - so far I've only worked with Solaris packages but it should also be possible through RPMs or Debian packages just like installing native daemons. I saw a few threads refer to a mono-service but they seemed a couple years old? The most up-to-date mono-service options are available through man mono-service. :-) And no, there are also more recent posts on this topic, e.g. by me around February, also some earlier related posts on the topic of running XSP as daemon. HTH, Andreas ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] mono service/SCM on linux how to
There is a service wrapper for the ServiceProcess class. Since all init.d the implements (or start-stop-pause daemons) have different flavors and variations in each distro, you will have to write the wrapper for your init.d yourself. You can find the source in the mcs source under mcs/tools/mono-service/ and you should have a program installed script installed with mono called 'mono-service'. You can also read the man page on it as well. The way it works is you write an sh script (or whatever you start/stop daemon uses) and have it invoke that app using these parameters: mono-service [-d:DIRECTORY] [-l:LOCKFILE] [-n:NAME] [-m:LOGNAME] servicename.exe The way it works is if you want to Stop the service, you pass in a SIGTERM kill command, if you want pause you kill with SIGUSR1, and to resume you call SIGUSR2. An example would be to start the service run: $ mono-service -l:/var/run/my-service-lock MyService.exe then to pause: $ kill -USR1 ‘cat /var/run/my-service-lock‘ to resume: $ kill -USR2 ‘cat /var/run/my-service-lock‘ and then to kill say: $ kill ‘cat /var/run/my-service-lock‘ Zac Bowling http://www.zacbowling.com/ On Mon, 2006-05-01 at 14:51 -0400, Nate Chadwick wrote: Hi, I have been trawling the list archives and the mono site on the recommended approach for writing / deploying a windows service to target linux but haven't been able to find a good reference. What is the current recommended approach for developing and deploying services with mono on linux? Basically I am looking to port a windows service so that it runs via /etc/init.d/natesnuclearservice start | stop | restart etc. I saw a few threads refer to a mono-service but they seemed a couple years old? Any pointers appreciated. Thanks, -n ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
RE: [Mono-list] mono service/SCM on linux how to
Thanks Zac. I didn't even think of checking the man pages. -n -Original Message- From: Zac Bowling [mailto:[EMAIL PROTECTED] Sent: Monday, May 01, 2006 4:31 PM To: Nate Chadwick Subject: Re: [Mono-list] mono service/SCM on linux how to There is a service wrapper for the ServiceProcess class. Since all init.d the implements (or start-stop-pause daemons) have different flavors and variations in each distro, you will have to write the wrapper for your init.d yourself. You can find the source in the mcs source under mcs/tools/mono-service/ and you should have a program installed script installed with mono called 'mono-service'. You can also read the man page on it as well. The way it works is you write an sh script (or whatever you start/stop daemon uses) and have it invoke that app using these parameters: mono-service [-d:DIRECTORY] [-l:LOCKFILE] [-n:NAME] [-m:LOGNAME] servicename.exe The way it works is if you want to Stop the service, you pass in a SIGTERM kill command, if you want pause you kill with SIGUSR1, and to resume you call SIGUSR2. An example would be to start the service run: $ mono-service -l:/var/run/my-service-lock MyService.exe then to pause: $ kill -USR1 'cat /var/run/my-service-lock' to resume: $ kill -USR2 'cat /var/run/my-service-lock' and then to kill say: $ kill 'cat /var/run/my-service-lock' Zac On Mon, 2006-05-01 at 14:51 -0400, Nate Chadwick wrote: Hi, I have been trawling the list archives and the mono site on the recommended approach for writing / deploying a windows service to target linux but haven't been able to find a good reference. What is the current recommended approach for developing and deploying services with mono on linux? Basically I am looking to port a windows service so that it runs via /etc/init.d/natesnuclearservice start | stop | restart etc. I saw a few threads refer to a mono-service but they seemed a couple years old? Any pointers appreciated. Thanks, -n ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] mono service/SCM on linux how to
Thanks, I was worried about the debugging thing. The best thing I can think of is implementing fairly heavy log4net style logging. This leads me to another question on the conf files for the service. I know typically linux service oriented apps place configuration files into /etc/. With .NET apps defaulting to appname.dll.config in the same dir as the executable, is the standard approach to symlink the config file to a proper location in /etc/? My target platform for production is SuSe though I have a couple of other flavors in the engineering to QA to production loop still (Gentoo/RHEL). Thanks, -n On 5/1/06, Andreas Färber [EMAIL PROTECTED] wrote: Hi Nate, I have been trawling the list archives and the mono site on the recommended approach for writing / deploying a windows service to target linux but haven't been able to find a good reference. The good reference depends pretty much on the Linux distribution you are targetting. Most documentation and links in the list archive are about Novell's SuSE Linux; I managed to get it working on Fedora Core (and Solaris) based on that, using documentation for native daemons/services. What is the current recommended approach for developing and deploying services with mono on linux? Basically I am looking to port a windows service so that it runs via /etc/init.d/natesnuclearservice start | stop | restart etc. Usually this involves having a distribution-specific shell script that spawns mono-service (or mono-service2 for .NET 2.0) and interacts with it via PID and signals. During initial development getting your service to work can be a little tricky as exceptions or Mono crashes are not logged. You might need to figure out how to manually call Mono with the managed mono-service class to see its output on the console. As for deployment, that depends on the system as well - so far I've only worked with Solaris packages but it should also be possible through RPMs or Debian packages just like installing native daemons. I saw a few threads refer to a mono-service but they seemed a couple years old? The most up-to-date mono-service options are available through man mono-service. :-) And no, there are also more recent posts on this topic, e.g. by me around February, also some earlier related posts on the topic of running XSP as daemon. HTH, Andreas ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] mono-service
Hi Jesse, 2005/12/2, Jesse Pasichnyk [EMAIL PROTECTED]: I just was browsing through some of the mono code/assemblies and ran across mono-service. It appears that this is a windows service like implementation that could now be used under linux or whatever other mono supported platform. I was just curious about the status of this and supporting assemblies; whether they are still being worked on, stable, etc. It's for running System.ServiceProcess based services on Linux (and maybe other UNIX like OS). The implementation of ServiceBase should be complete. Not many people seem to be using it. So I would rather not call it stable. But maybe it is ;-) The only known problem is a crash when stopping services on kernel 2.4 based systems. Also is there any available documentation on this aside from the man page for mono-service? Not yet. But theres something in the works. There was a longer thread some weeks ago: http://thread.gmane.org/gmane.comp.gnome.mono.general/24402 HTH, Joerg. ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
RE: [Mono-list] mono-service
I've produced some documentation about remoting in general that includes some stuff about mono-service. It is biased towards SuSE, but should be fairly easy to apply elsewhere. In fact I'd be very grateful if people could add sections about other distributions. I'm not claiming the documents are that good, by the way, but if anyone wants a copy please let me know and I'll send it to your private email. It's too large for the list. Peter -Original Message- From: Jörg Rosenkranz [mailto:[EMAIL PROTECTED] Sent: 02 December 2005 10:21 To: Jesse Pasichnyk Cc: mono-list@ximian.com Subject: Re: [Mono-list] mono-service Hi Jesse, 2005/12/2, Jesse Pasichnyk [EMAIL PROTECTED]: I just was browsing through some of the mono code/assemblies and ran across mono-service. It appears that this is a windows service like implementation that could now be used under linux or whatever other mono supported platform. I was just curious about the status of this and supporting assemblies; whether they are still being worked on, stable, etc. It's for running System.ServiceProcess based services on Linux (and maybe other UNIX like OS). The implementation of ServiceBase should be complete. Not many people seem to be using it. So I would rather not call it stable. But maybe it is ;-) The only known problem is a crash when stopping services on kernel 2.4 based systems. Also is there any available documentation on this aside from the man page for mono-service? Not yet. But theres something in the works. There was a longer thread some weeks ago: http://thread.gmane.org/gmane.comp.gnome.mono.general/24402 HTH, Joerg. ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
RE: [Mono-list] mono-service
Hi Peter and Joerg, I've been digging around forthe whole weekin order to make the mono-service work, the attached TestService code saved me a lot of time. Very appreciate. I compiled and ran it on my machine (Suse 10 desktop), it's working fine on the command line. Here are my observations and questions: 1. Youwere creating 2 services in the MainClass, but only TestService1 called the OnStart(), although both services were disposed at the end. 2. The whole structure of your TestService is different from a Windows service created on Visual Studio.NET. On VS.NET, the Main() is included within the Service class, which inherits the ServiceBase. I was porting a Windows project to Linux sotheWindows structure was used, and obviously it didn't work on Linux. This is not documented anywhere so fordevelopers trying to make a mono service to work, it really gives us a hard time. 3. The Test Service works fine on thecommand line, but the whole point is to run it at system startup, so I created an init script following the guide given by Novell (http://www.novell.com/coolsolutions/feature/15380.html). However, the startproc command throws me an error: "cannot execute binary file.", but run it from a command line is fine (startproc /usr/bin/mono-service /path/to/TestService.exe). So I am stuck again when trying to run a mono service at startup, hope you could help me out. 4. How can I join the mono-list so my emails won't get bounced back? 5. I really want to write something about porting a mono service after I get my current project done. The material about this area is really rare. Where would be the best place to post, say an article with sample source code? Thanks, Wilson From: Jörg Rosenkranz [EMAIL PROTECTED]To: "Bradley, Peter" [EMAIL PROTECTED],"WILSON LEI" [EMAIL PROTECTED],mono-list@lists.ximian.comSubject: RE: [Mono-list] mono-serviceDate: Tue, 1 Nov 2005 13:31:16 +0100 Hi all, ?lt;/div I suppose you are missing the ServiceBase.Run call in your Main method: ?lt;/div System.ServiceProcess.ServiceBase[] servicesToRun; servicesToRun = new System.ServiceProcess.ServiceBase[] { new TestService("TestService1")}; System.ServiceProcess.ServiceBase.Run(servicesToRun); ?lt;/div 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. ?lt;/div Another idea: mono-service logs errors into syslog. Did you look into /var/log/messages? ?lt;/div Joerg. -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bradley, PeterSent: Tuesday, November 01, 2005 11:08 AMTo: WILSON LEI; mono-list@lists.ximian.comSubject: RE: [Mono-list] mono-service Could I take the opportunity to add my voice to this??I was intending to post something similar when Id done a bit more work on the topic, but Wilson has beaten me to it. ?lt;/span The mono-service man pages are very sparse.?If I can get it working, Id be very happy to write it up as a How-To sort of document for others. ?lt;/span Thanks ?lt;/span ?lt;/span Peter ?lt;/span From: WILSON LEI [mailto:[EMAIL PROTECTED] Sent: 31 October 2005 13:44To: mono-list@lists.ximian.comSubject: [Mono-list] mono-service ?lt;/span Hi, ?lt;/span 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? ?lt;/span 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? ?lt;/span Thanks, ?lt;/span Wilson TestService.cs ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
RE: [Mono-list] mono-service
Title: Nachricht No, that's not true. Mono-service should be as compatible as possible. Our service (developed on Windows) runs on Mono/Linux too. Joerg. -Original Message-From: Bradley, Peter [mailto:[EMAIL PROTECTED] Sent: Thursday, November 03, 2005 10:45 AMTo: WILSON LEI; Jörg Rosenkranz; mono-list@lists.ximian.comSubject: RE: [Mono-list] mono-service Ysgrifennodd WILSON LEI: 2. The whole structure of your TestService is different from a Windows service created on Visual Studio.NET. On VS.NET, the Main() is included within the Service class, which inherits the ServiceBase. I was porting a Windows project to Linux sotheWindows structure was used, and obviously it didn't work on Linux. This is not documented anywhere so fordevelopers trying to make a mono service to work, it really gives us a hard time. Is this true? Will a service developed in Windows not work under Linux? This might explain why Im having so many problems. Cheers Peter ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
RE: [Mono-list] mono-service
Title: Nachricht Thanks Jörg. Ill keep trying to get mine working, then. So far Ive had no luck (on Mono/Linux). Cheers Peter From: Jörg Rosenkranz [mailto:[EMAIL PROTECTED] Sent: 03 November 2005 10:37 To: Bradley, Peter; WILSON LEI; mono-list@lists.ximian.com Subject: RE: [Mono-list] mono-service No, that's not true. Mono-service should be as compatible as possible. Our service (developed on Windows) runs on Mono/Linux too. Joerg. -Original Message- From: Bradley, Peter [mailto:[EMAIL PROTECTED] Sent: Thursday, November 03, 2005 10:45 AM To: WILSON LEI; Jörg Rosenkranz; mono-list@lists.ximian.com Subject: RE: [Mono-list] mono-service Ysgrifennodd WILSON LEI: 2. The whole structure of your TestService is different from a Windows service created on Visual Studio.NET. On VS.NET, the Main() is included within the Service class, which inherits the ServiceBase. I was porting a Windows project to Linux sotheWindows structure was used, and obviously it didn't work on Linux. This is not documented anywhere so fordevelopers trying to make a mono service to work, it really gives us a hard time. Is this true? Will a service developed in Windows not work under Linux? This might explain why Im having so many problems. Cheers Peter ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
RE: [Mono-list] mono-service
Title: Nachricht Hi Peter, -Original Message-From: Bradley, Peter [mailto:[EMAIL PROTECTED] Sent: Thursday, November 03, 2005 11:43 AMTo: Jörg Rosenkranz; WILSON LEI; mono-list@lists.ximian.comSubject: RE: [Mono-list] mono-service Thanks Jörg. Ill keep trying to get mine working, then. So far Ive had no luck (on Mono/Linux). What happens if you start your service by hand and not using the start script? Do you have any messages in /var/log/messages? Joerg. ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
RE: [Mono-list] mono-service
Title: Nachricht Good point, Jörg. Im at work at the moment (a room full of Windows) but Ill check it out tonight when I get back to fighting with my Linux box and Mono J Im afraid I get seduced by Windows and forget to do the obvious things on Linux, like check the logs L By the way, how should I spell your name Jörg/Joerg? Peter From: Jörg Rosenkranz [mailto:[EMAIL PROTECTED] Sent: 03 November 2005 11:00 To: Bradley, Peter; WILSON LEI; mono-list@lists.ximian.com Subject: RE: [Mono-list] mono-service Hi Peter, -Original Message- From: Bradley, Peter [mailto:[EMAIL PROTECTED] Sent: Thursday, November 03, 2005 11:43 AM To: Jörg Rosenkranz; WILSON LEI; mono-list@lists.ximian.com Subject: RE: [Mono-list] mono-service Thanks Jörg. Ill keep trying to get mine working, then. So far Ive had no luck (on Mono/Linux). What happens if you start your service by hand and not using the start script? Do you have any messages in /var/log/messages? Joerg. ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] mono-service
Jrg Rosenkranz wrote: Nachricht What happens if you start your service by hand and not using the start script? Do you have any messages in /var/log/messages? Joerg. Here's a hint (from /var/log/messages): Nov 3 19:00:58 linux su: (to root) peter on /dev/pts/1 Nov 3 19:01:07 linux mono: RemoteSumsService.exe: Exception has been thrown by the target of an invocation. Nov 3 19:01:07 linux mono: RemoteSumsService.exe: Exception has been thrown by the target of an invocation. Nov 3 19:01:07 linux mono: RemoteSumsService.exe: Configuration file '/home/peter/MonoRemotingTest/RemoteSumsService/bin/Release/RemoteSumsService.exe.config' could not be loaded: Error in element customErrors: Invalid custom error mode: Off We've been through this before. Windows insists that the value of the mode attribute in customErrors is "Off" with a capital "O". Robert did something to make Mono case insensitive - but it's likely that's not in my installation yet. Anyway, I changed the value to "off" and everything worked beautifully. My sincere apologies for not doing the obvious thing and looking in /var/log/messages before now. Put it down to my advancing years. As we say over here, "Henaint ni ddaw ei hun" (Old age doesn't come on its own). Now, would anyone please be good enough to explain to me how I can get this to start up when I boot the machine so that the daemon will run without the need for anyone to log in? Or point me at the documentation where I can work it out for myself, of course. Many thanks. Peter ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
RE: [Mono-list] mono-service
Could I take the opportunity to add my voice to this? I was intending to post something similar when Id 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, Id 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 ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
RE: [Mono-list] mono-service
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, PeterSent: Tuesday, November 01, 2005 11:08 AMTo: WILSON LEI; mono-list@lists.ximian.comSubject: RE: [Mono-list] mono-service Could I take the opportunity to add my voice to this? I was intending to post something similar when Id 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, Id 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:44To: mono-list@lists.ximian.comSubject: [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 TestService.cs Description: TestService.cs ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
RE: [Mono-list] mono-service
Title: Nachricht Hello Wilson, 1. Youwere creating 2 services in the MainClass, but only TestService1 called the OnStart(), although both services were disposed at the end. Two services can live together in one EXE. Mono-service can start only one at a time (select using -n parameter, default is first), on windows you are able to start both using the service controller. The behaviour should be equivalent to .NET. In most cases there will be only one service in one EXE. 2. The whole structure of your TestService is different from a Windows service created on Visual Studio.NET. On VS.NET, the Main() is included within the Service class, which inherits the ServiceBase. I was porting a Windows project to Linux sotheWindows structure was used, and obviously it didn't work on Linux. This is not documented anywhere so fordevelopers trying to make a mono service to work, it really gives us a hard time. My test service was created initially on Windows and it runs on Windows too. I don't know what you are doing differently.What do your service body look like? I'm using VS 2003/.NET 1.1. 3. The Test Service works fine on thecommand line, but the whole point is to run it at system startup, so I created an init script following the guide given by Novell (http://www.novell.com/coolsolutions/feature/15380.html). However, the startproc command throws me an error: "cannot execute binary file.", but run it from a command line is fine (startproc /usr/bin/mono-service /path/to/TestService.exe). So I am stuck again when trying to run a mono service at startup, hope you could help me out. IIRC startproc is for running exes only. Mono-service is a wrapper shell script.Try using startproc /usr/bin/mono /usr/bin/mono-service.exe /path/to/TestService.exe. 4. How can I join the mono-list so my emails won't get bounced back? ?? 5. I really want to write something about porting a mono service after I get my current project done. The material about this area is really rare. Where would be the best place to post, say an article with sample source code? The best place would be the Wiki on http://www.mono-project.com/but I don't know how accounts are given to new users. Joerg. ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
RE: [Mono-list] mono-service
Hello, 5. I really want to write something about porting a mono service after I get my current project done. The material about this area is really rare. Where would be the best place to post, say an article with sample source code? The best place would be the Wiki on http://www.mono-project.com/ but I don't know how accounts are given to new users. Just put together a draft, and once you have that, I can give you the Wiki account to publish it. Miguel. ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] mono-service
Miguel de Icaza wrote: Just put together a draft, and once you have that, I can give you the Wiki account to publish it. Anyone who wants a copy of the stuff I've done on remoting just has to ask. I can't post it to the list because even tarred and zipped it's way over the 25kb limit for the list. Peter ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list