一:安装Mono,此步骤参照官网

1:配置Yum仓库

#Centos 7
yum install yum-utils
rpm --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
yum-config-manager --add-repo http://download.mono-project.com/repo/centos7/ 如若yum安装失败,可自己手动写repo文件,vim /etc/yum.repos.d/mono.repo' [mono]

name=mono
baseurl=http://download.mono-project.com/repo/centos/
enabled=1
gpgcheck=0

保存退出之后,再进行后续步骤!

#Centos
yum install yum-utils
rpm --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
yum-config-manager --add-repo http://download.mono-project.com/repo/centos6/

2:安装mono

yum install mono-devel
#这里面是官网的安装说明,一般情况下安装devel就可以了!,安装所有,可以把对应的包名都加上! The package mono-devel should be installed to compile code. The package mono-complete should be installed to install everything - this should cover most cases of "assembly not found" errors. The package referenceassemblies-pcl should be installed for PCL compilation support - this will resolve most cases of "Framework not installed: .NETPortable" errors during software compilation. The package xsp should be installed for running ASP.NET applications.

二:配置windows程序的开机启动项

1: vim /etc/init.d/mfgRemotingServer,并输入以下内容

#!/bin/bash
#
#chkconfig:
#description:remotingservice
start()
{
#这里面的-l是指定lock文件,后面跟的是exe程序所在的绝对路径,可以通过mono-service命令查看帮助
mono-service -l:/root/remotingservice-lock /home/setquestion/Mfg.Setquestion.RemotingServer.exe
}
stop()
{
kill `cat /root/remotingservice-lock`
}
case "$1" in
start)
start
;; stop)
stop
;; restart)
stop
start
;;
*)
echo
$"Usage: $0 {start|stop|restart}"
exit
esac

2:执行时service mfgRemotingServer stop 会遇到  env: /etc/init.d/mfgRemotingServer: Permission denied,解决办法如下:

chmod +x /etc/init.d/mfgRemotingServer
service mfgRemotingServer stop
#加入到开机启动项
chkconfig --add mfgRemotingServer
chkconfig mfgRemotingServer on

3:mono-service的相关参数如下:

You must specify at least the assembly name

Usage is: /usr/bin/mono-service [options] service

    -d:<directory>         Working directory
-l:<lock file> Lock file (default is /tmp/<service>.lock)
-m:<syslog name> Name to show in syslog
-n:<service name> Name of service to start (default is first defined)
--debug Do not send to background nor redirect input/output
--no-daemon Do not send to background nor redirect input/output Controlling the service: kill -USR1 `cat <lock file>` Pausing service
kill -USR2 `cat <lock file>` Continuing service
kill `cat <lock file>` Ending service

PS:如果给为在安装和配置过程中有任何疑问,望留言。

Centos下安装最新版Mono并为windwos服务配置开机启动项的更多相关文章

  1. Centos下安装FTP并进行虚拟用户访问方式配置

    1. 安装认证所需包 [root@localhost]#yum install pam* [root@localhost]#yum install db4* 首先安装PAM(用于用户认证)和DB4(用 ...

  2. centos下安装最新版本git(通过master分支下载最新版)

    centos6.7下安装最新版本git 本文参考:http://www.01happy.com/centos-install-latest-git/ 按照原博主所提供的思路安装可能会出现下列问题 解决 ...

  3. CentOS下安装hadoop

    CentOS下安装hadoop 用户配置 添加用户 adduser hadoop passwd hadoop 权限配置 chmod u+w /etc/sudoers vi /etc/sudoers 在 ...

  4. CentOS下安装使用start-stop-daemon

    CentOS下安装使用start-stop-daemon 在centos下下了个自启动的服务器脚本 执行的时候发现找不到start-stop-daemon命令 好吧 执行手动编译一下 加上这个命令 w ...

  5. 从零开始学 Java - CentOS 下安装 Tomcat

    生活以痛吻我,我仍报之以歌 昨天晚上看到那个冯大辉老师的微信公众号,「小道消息」上的一篇文章,<生活以痛吻我,我仍报之以歌>.知乎一篇匿名回答,主题为<冯大辉到底是不是技术大牛,一个 ...

  6. CentOS 下安装

    2016年12月5日15:25:58 ----------------------------------- 通常情况下在centos下安装软件就用yum. 关键是,使用yum你要知道安装包的名字是什 ...

  7. [Linux]CentOS下安装和使用tmux

    前天随意点开博客园,看到了一篇关于tmux的文章 Tmux - Linux从业者必备利器,特意还点进去看了.毕竟Linux对于做游戏服务端开发的我来说,太熟悉不过了.不过我就粗略地看了一眼,就关掉了. ...

  8. CentOS下安装JDK7 转载

    转载地址:http://www.cnblogs.com/rilley/archive/2012/02/02/2335395.html CentOS下安装JDK7 下载地址:http://www.ora ...

  9. Centos下安装mysql 总结

    一.MySQL安装 Centos下安装mysql 请点开:http://www.centoscn.com/CentosServer/sql/2013/0817/1285.html 二.MySQL的几个 ...

随机推荐

  1. Mac 下netstat和linux下不一样

    Linux's netstat command options and OS X(/BSD)'s have almost nothing to do with each other. Of the o ...

  2. iOS开发中与库相关的术语

    动态库 VS 静态库 Static frameworks are linked at compile time. Dynamic frameworks are linked at runtime

  3. FastReport

    看下面 https://www.cnblogs.com/m0488/category/477792.html

  4. @requestParamore与@pathvariable的区别

    http://localhost:8080/Springmvc/user/page.do?pageSize=3&pageNow=2 你可以把这地址分开理解,其中问号前半部分:http://lo ...

  5. 附加题:将四则运算源代码上传到Github账户上

    1.创建仓库用于存储管理本地文件 2.远程添加github上的Blog仓库. 3.获取github中Blog仓库的地址. 4.在Add Remote窗口中填写名字.Location. 5.将本地文件通 ...

  6. LinuxC下获取UDP包中的路由目的IP地址和头标识目的地址

    在接受到UDP包后,有时候我们需要根据所接收到得UDP包,获取它的路由目的IP地址和头标识目的地址. (一)主要的步骤: 在setsockopt中设置IP_PKTINFO,然后通过recvmsg来获取 ...

  7. ConcurrentHashMap源码解析(2)

    此文已由作者赵计刚授权网易云社区发布. 欢迎访问网易云社区,了解更多网易技术产品运营经验. ConcurrentHashMap()     /**      * 创建ConcurrentHashMap ...

  8. 【npm】利用npm安装/删除/发布/更新/撤销发布包

      什么是npm? npm是javascript的包管理工具,是前端模块化下的一个标志性产物 简单地地说,就是通过npm下载模块,复用已有的代码,提高工作效率   1.从社区的角度:把针对某一特定问题 ...

  9. Lerning Entity Framework 6 ------ Introduction to TPH

    Sometimes, you have created two models. They have the same parent class like this: public class Pers ...

  10. SpringBoot2 web

    验证框架 SpringBoot支持JSR-303,Bean等验证框架 JSR-303 JSR-303是Java的标准验证框架,已有实现Hibernate validator. JSR-303验证类型 ...