[Mono-devel-list] monod: System.ServiceProcess on Linux
Jörg Rosenkranz
joergr at voelcker.com
Tue Mar 8 12:44:36 EST 2005
Hi all,
Attached is the first incarnation of a Mono Linux daemon to run
.NET services developed using System.ServiceProcess.
The daemon exports an internal call which is used by ServiceBase to
get the service objects from the managed service.
To test this daemon you have to:
1. Patch System.ServiceProcess and install the new assembly
2. Put the 3 other files in a directory
3. make (Very simple makefile, should do in most cases)
To run the created service:
$ ./monod TestService.exe
Watch out for syslog messages (created by the daemon) and entries in
TestService.log (created by the service itself).
The service can be controlled by signals.
Pausing it:
$ kill -USR1 <process id>
Continuing:
$ kill -USR2 <process id>
Stopping:
$ kill <process id>
A transcript of such a session in /var/log/messages looks like:
Mar 8 19:21:51 vidrd115 TestService.exe[5040]: Starting service Test Service...
Mar 8 19:24:29 vidrd115 TestService.exe[5040]: Pausing service Test Service...
Mar 8 19:25:18 vidrd115 TestService.exe[5040]: Continuing service Test Service...
Mar 8 19:25:57 vidrd115 TestService.exe[5040]: Stopping service Test Service...
Known problems:
If there is more than one service registered in Main it's not
possible to select one using the -n parameter yet.
I would like to hear opinions on this implementation (My C skills
are a bit rusty ;-)).
Is it possible to include this daemon in Mono? A not so generic
implementation is running our Windows service on lots of Linux
servers without problems.
Thanks,
Joerg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ServiceProcess.diff
Type: application/octet-stream
Size: 1740 bytes
Desc: ServiceProcess.diff
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050308/9095a8e1/attachment.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile
Type: application/octet-stream
Size: 292 bytes
Desc: Makefile
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050308/9095a8e1/attachment-0001.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: monod.c
Type: application/octet-stream
Size: 9625 bytes
Desc: monod.c
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050308/9095a8e1/attachment-0002.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestService.cs
Type: application/octet-stream
Size: 2511 bytes
Desc: TestService.cs
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050308/9095a8e1/attachment-0003.obj
More information about the Mono-devel-list
mailing list