[Mono-list] Auto Running Processeses

Travis Staloch twostepted at yahoo.com
Fri Jun 23 13:13:31 EDT 2006


I've attached a file with some code from my app.  I hope it helps get you going in the right direction as it has worked for me on windows and linux.  There are some comments between sections in the attached code.  I've included a method where the TcpListener is instantiated, a MyService base class and a Driver class which inherits from MyService.  Look for the ServiceMain method in the Driver class and create your TcpListener therein.  

Let me know how it goes,


Lee <lee at datatrakpos.com> wrote:     Thanks a bunch, Travis.
 I was wondering...for your socket server, do you use  asynchronous sockets?  I have tried using a TcpListener from within  a  service application and the socket server fails to start.  I'm wondering  what pattern you used for your socket server.
 Thanks again,

   From: Travis Staloch    [mailto:twostepted at yahoo.com] 
Sent: Friday, June 23, 2006 2:03    AM
To: Lee
Subject: RE: [Mono-list] Auto Running    Processeses


Here in the init.d file which I've used to start my    mono service.  I hope that you're able to get your service working on    mono.  I know that mine took a little work to get ported over to    linux.

I think you just have to put this script in your /etc/init.d    folder to get it to run at startup.  I might be wrong.  Let me know    how it goes if you have time.


Lee    <lee at datatrakpos.com> wrote:             Travis, 
     Would you mind terribly providing me with a copy of the      script that you used?  I have tried the script link that you sent me      and I can't seem to get it to work.

       From: mono-list-bounces at lists.ximian.com        [mailto:mono-list-bounces at lists.ximian.com] On Behalf Of Travis        Staloch
Sent: Tuesday, June 20, 2006 1:39 AM
To:        mono-list at ximian.com
Subject: Re: [Mono-list] Auto Running        Processeses


I've written a C# TCP socket service which runs on        windows and linux.  It uses System.ServiceProcess, inheriting from        System.ServiceProcess.ServiceBase.  The app was originally written on        windows and worked fine there installed as a service using        installutil.  When I moved over to linux, I discovered that I had to        start it with MonoService.exe (found in MonoRoot/bin I think).         

I had to write an init.d script similar to the one mentioned here in order to get the process launched at OS        startup.  


Lee        <lee at datatrakpos.com> wrote:        

Hi          all, 

I apologize for the basic question here, but I am new to          linux. To make
things a bit easier on myself, I'm using VS2005 for my          development since I
use that for windows development as well. I am          writing a TCP socket server
and want it to run as an automatic          process. 

Should that be written as a console app or as a Service          app?

Again, sorry for the basic          question.



Mono-list          maillist -          Mono-list at lists.ximian.com

       Want to be your own boss? Learn how on Yahoo!        Small Business. 
No virus found in this incoming        message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus        Database: 268.9.1/369 - Release Date: 6/19/2006



   Yahoo! Messenger with Voice. Make    PC-to-Phone Calls to the US (and 30+ countries) for 2�/min or less.
No virus found in this incoming message.
Checked by    AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.2/372 - Release    Date: 6/21/2006


Sneak preview the  all-new Yahoo.com. It's not radically different. Just radically better. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20060623/1316344f/attachment-0001.html 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: TcpListenerServiceCode.txt
Url: http://lists.ximian.com/pipermail/mono-list/attachments/20060623/1316344f/attachment-0001.txt 

More information about the Mono-list mailing list