开发者

How to run exe in mono in the background

Okay, so I have a .net exe, and it runs when I type mono myexe.exe. However, if I want to use another command or close the terminal window the app stops executing.

I have tried using mono myexe.exe & and it runs and showing [8] 20078 etc., but once I type something else it shows [8]+ Stopped开发者_如何学Go, and then executes the command I typed in.

Any ideas?


how about nohup mono myexe.exe &


If you want to use & then look into outputting the result to a file.

nohup mono program.exe > program.out &

The right way of doing this would be to create a daemon with your linux distro.


You can also run it as an service using this line of code:

mono-service -l:/tmp/myservice.lock ./ServiceDaemon.exe

where -l:LOCKFILE specifies the file to use for locking. When you look into your lock file, you will see the process id. The process id you can use to kill the service, whenever you need to terminate it.

Source: blog.chudinov.net

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜