mono-service

How to detect if I'm running in mono-service?

ε祈祈猫儿з 提交于 2019-11-30 20:35:50
How can I detect I'm running under mono-service2? (in C#/.NET 3.5, running mono 2.6.7 on ubuntu 11) Type.GetType("Mono.Runtime") tells me I'm running in mono, so that part is ok. But Environment.UserInteractive is always false under mono it seems, so I'm struggling to figure out if I'm actually running under mono-service2 - with no console/terminal. Environment.UserInteractive is the proper solution but, unfortunately, it is currently not implemented in Mono. I may take a look on it someday and upgrade this answer ;) However just to detect you can probably use hacky solution around this one:

Success with start-stop-daemon and mono-service2?

邮差的信 提交于 2019-11-30 12:33:59
问题 Has anyone had any success using start-stop-daemon and mono-service2 together? I've been fighting this for a few days now and have gotten various bits to work, but have had no success in getting a fully functional init script for a mono service. Here is what I have learned to date: The mono or mono-service exe must be named as the variable DAEMON (you can't list your exe as the DAEMON) You must use the --background flag ... otherwise when this script is executed from a package installer (deb

How to detect if I'm running in mono-service?

为君一笑 提交于 2019-11-30 04:25:53
问题 How can I detect I'm running under mono-service2? (in C#/.NET 3.5, running mono 2.6.7 on ubuntu 11) Type.GetType("Mono.Runtime") tells me I'm running in mono, so that part is ok. But Environment.UserInteractive is always false under mono it seems, so I'm struggling to figure out if I'm actually running under mono-service2 - with no console/terminal. 回答1: Environment.UserInteractive is the proper solution but, unfortunately, it is currently not implemented in Mono. I may take a look on it

How do I code a Mono Daemon

≯℡__Kan透↙ 提交于 2019-11-29 20:20:13
I'm trying to write a Mono C# daemon for linux. I'd like to do a starts and stops of it when its done processing instead of just killing the process. Does anyone have any examples of this? Edit: I figured out how to use start-stop-daemon --background in debian, so I think I'll just use that for now. Edit: I'm implementing this in java as well and they have this nice addShutdownHook that catches terminating the app. I need to spend a little more time sorting out the dependencies for mono service, or find a way to catch app termination. There is the SessionEnd event, but thats only available for

How do I code a Mono Daemon

若如初见. 提交于 2019-11-28 16:25:41
问题 I'm trying to write a Mono C# daemon for linux. I'd like to do a starts and stops of it when its done processing instead of just killing the process. Does anyone have any examples of this? Edit: I figured out how to use start-stop-daemon --background in debian, so I think I'll just use that for now. Edit: I'm implementing this in java as well and they have this nice addShutdownHook that catches terminating the app. I need to spend a little more time sorting out the dependencies for mono

using mono-service to wrap a windows service on linux

纵饮孤独 提交于 2019-11-27 18:03:15
Hi I'm trying to use mono-service2 to run a stock Windows Service Project from visual studio. I'm running this on debian with mono 2.0 and compiling with. gmcs *.cs -pkg:dotnet I try and start with this (I've tried with -d set to the dir with the app and -n,-m set) mono-service2 -l:service.lock --debug Program.exe The only code change is to add writelines for testing Service1.cs using System; using System.ServiceProcess; namespace spikes { public partial class Service1 : ServiceBase { public Service1() { InitializeComponent(); } protected override void OnStart(string[] args) { Console

using mono-service to wrap a windows service on linux

断了今生、忘了曾经 提交于 2019-11-26 19:15:47
问题 Hi I'm trying to use mono-service2 to run a stock Windows Service Project from visual studio. I'm running this on debian with mono 2.0 and compiling with. gmcs *.cs -pkg:dotnet I try and start with this (I've tried with -d set to the dir with the app and -n,-m set) mono-service2 -l:service.lock --debug Program.exe The only code change is to add writelines for testing Service1.cs using System; using System.ServiceProcess; namespace spikes { public partial class Service1 : ServiceBase { public