如何添加我的单计划,以启动? [英] How do I add my mono Program to the startup?

查看:124
本文介绍了如何添加我的单计划,以启动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很新的Ubuntu Linux系统。我已经部署在EC2上一个单声道的应用程序。目前我使用单文件夹/ APP.EXE 启动该程序。 我怎样才能让这个运行在系统重新启动时?

I am very new to Ubuntu. I've a mono application deployed on EC2. Currently I use mono folder/app.exe to start the program. How can I make this run when the system reboots?

在此先感谢。

更新: - 除了下面的答案,我搬到了文件夹 / OPT 。否则,它被扔库没有发现错误。

UPDATE:- In addition to the below answer, I've moved the folder to /opt. Otherwise it was throwing library not found error.

推荐答案

我建议使用新贵。例如:

I'd suggest using upstart. Example:

/etc/init/app.exe.conf

/etc/init/app.exe.conf

description "My Mono app"

start on runlevel [2345]
stop on runlevel [016]

setuid nobody
setgid nogroup
respawn
console log

exec /path/to/app.exe

它将运行你的应用程序为用户nobody,重新启动它,如果它崩溃并记录所有输出/var/log/upstart/app.exe.log。要手动启动和停止它,你会使用开始APP.EXE和停止APP.EXE。 你当然可以命名配置文件别的东西,像myapp.conf。见新贵网站了解更多信息: http://upstart.ubuntu.com/

It will run your app as user nobody, restart it if it crashes and log all output to /var/log/upstart/app.exe.log. To manually start and stop it you'd use "start app.exe" and "stop app.exe". You can of course name the config file something else, like myapp.conf. See the upstart site for more info: http://upstart.ubuntu.com/

这篇关于如何添加我的单计划,以启动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆