I have a .NET application that i can compile as console application or as a windows service.
This application should run when the system starts and run as long as the system is running.
I want to run it on Linux using Mono.
Should I use mono service or just run the console application with mono using a deamon?
Asked
Active
Viewed 989 times
0

uriz
- 567
- 9
- 25
-
Try: http://stackoverflow.com/questions/637948/how-to-migrate-a-net-windows-service-application-to-linux-using-mono or http://stackoverflow.com/questions/1221110/windows-like-services-development-in-linux-using-mono?rq=1 – SushiHangover Oct 29 '15 at 18:45
-
@RobertN my question is which one is better. mono service OR consola app with deamon – uriz Oct 29 '15 at 19:02
-
1I've done both and seen both done... personal preference I guess, if you start with a Windows server, then using mono-service makes sense. Now days, I just wrap them in a `systemd` script (plus the `.service` file) since systemd is the standard on most/all Linux systems now (even though there are lots of people that are still complaining about it's adoption) – SushiHangover Oct 29 '15 at 19:16
-
@RobertN so if i understand you correctly, just stay with mono + console app and run it with a start-up script? – uriz Oct 29 '15 at 19:51
-
1That is what I personally do... Take a look at the answer on this stack exchange, it parallels what I do, but of course I am `exec`'ing a script that starts my `mono xxx.exe` if a process id/name does not exist for it and signals for its exit when stop() is called ( I monitor for signals via UnixSignal on a shutdown thread as I prefer a clean shutdown). Also lots of ways to run a 'singleton' style Mono process, stackoverflow as a bunch of related Q/As, but I'm an Occam's razor guy and just use a `.pid` file : http://unix.stackexchange.com/questions/47695/how-to-write-startup-script-for-systemd – SushiHangover Oct 29 '15 at 20:44
-
@RobertN Thanks for your help. i run as you described. – uriz Oct 30 '15 at 12:36