RE: [Mono-list] mono service/SCM on linux how to

2006-05-02 Thread Bradley, Peter
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

2006-05-01 Thread Andreas Färber
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

2006-05-01 Thread Zac Bowling
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

2006-05-01 Thread Nate Chadwick

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

2006-05-01 Thread Nate Chadwick

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