如何迁移使用单一个.NET Windows服务应用到Linux?NET、Windows、Linux

由网友(何必天真)分享简介:什么是使用单一个.NET Windows服务迁移到Linux的最好的方法?我一直在试图避免执行的应用程序作为调度命令。 What would be the best approach to migrate a .NET Windows Service to Linux using mono? I've been tr...

什么是使用单一个.NET Windows服务迁移到Linux的最好的方法?我一直在试图避免执行的应用程序作为调度命令。

What would be the best approach to migrate a .NET Windows Service to Linux using mono? I've been trying to avoid executing the application as a scheduled command.

是否有可能获得服务/系统守护进程(在Linux)样的行为?

Is it possible to obtain a service/system daemon(in linux) like behavior?

推荐答案

在Linux下,守护程序是简单的后台进程。没有特殊的控制方法(如的start()停止())被用作Windows中。建立服务作为一个简单的(控制台)应用程序,并在后台运行。使用如 以进程 一个工具来运行一个程序作为Unix的守护进程,并记住指定作为程序被激活。

Under Linux, deamons are simple background processes. No special control methods (e.g start(), stop()) are used as in Windows. Build your service as a simple (console) application, and run it in the background. Use a tool like daemonize to run a program as a Unix daemon, and remember to specify mono as the program to be activated.

正如其他人,单服务是一台主机运行内置的 ServiceProcess 组装。专为Windows服务可以使用这个方法在Linux下运行未经修改的。您可以通过发送信号的过程(参见手册页)控制服务。

As noted by others, mono-service is a host to run services built with the ServiceProcess assembly. Services built for Windows can use this method to run unmodified under Linux. You can control the service by sending signals to the process (see man page).

阅读全文

相关推荐

最新文章