[Pkg-mono-devel] mono-service2 - how to automate start/stop on Ubuntu (Debian?)

Ade javickers at yahoo.co.uk
Tue Nov 2 18:59:10 UTC 2010


List,

Firstly, if I'm posting this in the wrong place, I apologise & would appreciate a re-direct.

I've written a number of Windows Services using .Net 1.1, which have been deployed all over the place & work fine. However, with M$ introducing Win7 & finally stopping selling XP licences, I've turned to Linux as an alternative platform.

After a bit of platform-dependant code tweaking, I can now make my services run just fine in Linux, using the command "mono-service2 <service.name.exe>"; and later stop them using "kill `cat /tmp/<service.name.exe>`.

All well & good, but I'd like the services to auto-start when the machine is started; and, ideally, auto-restart if one of them crashes (as it seems to periodically do)...

I'm guessing the stop/start function should be achieved using an init.d script; and the monitoring function via a cron job. Unfortunately, my grasp of init.d is sufficiently shaky to be dangerous, so I'd really appreciate it if someone could post up an example (just a really simple one will do) showing how one would use an init.d script to start & stop a service using mono-service2 as the wrapper.

Thanks in advance!
Ade.


      



More information about the Pkg-mono-devel mailing list