[Mono-devel-list] System.ServiceProcess (RE: [Mono-list] services and daemons)
Jörg Rosenkranz
joergr at voelcker.com
Tue Aug 19 10:04:30 EDT 2003
Hello,
I've done a little proof of concept to run services under Mono/Linux.
The attached test program (quick and dirty!) is a little daemon
embedding Mono. It is able to instantiate a class based on ServiceBase
and calls the On... functions. It is controlled using signals.
How to test the sample:
- Apply supplied patch to System.ServiceProcess.ServiceBase
- Build the samples
make
- Run test daemon
testdaemon testservice.exe TestService TestService
- Pause
kill -USR1 `cat /tmp/testdaemon.lock`
- Continue
kill -USR2 `cat /tmp/testdaemon.lock`
- Stop
kill `cat /tmp/testdaemon.lock`
It's my first embedded Mono app so please be forgiving ;-)
Known problems:
- Entry point of service will not be called
- Infrastructure of namespace System.ServiceProcess is not used
except of class ServiceBase
- Rudimental error and exception handling
- Only one service can be started in parallel
- CanPauseAndContinue is ignored
- Main thread is polling for signals
- Service class is not checked to be a child of ServiceBase
- ...
Any comments are highly appreciated!
Thanks,
Joerg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestDaemon.tgz
Type: application/x-compressed
Size: 2670 bytes
Desc: TestDaemon.tgz
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20030819/5bc70652/attachment.bin
More information about the Mono-devel-list
mailing list