Centos下安装最新版Mono并为windwos服务配置开机启动项

2021-04-30 18:26

阅读:561

标签:mission   redirect   bsp   .exe   查看   kconfig   arch   最新   art   

一:安装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/
#Centos 6
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: 2345 20 80 #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 1 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:         Working directory
    -l:file>         Lock file (default is /tmp/.lock)
    -m:       Name to show in syslog
    -n:      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 file>`    Pausing service
    kill -USR2 `cat file>`    Continuing service
    kill `cat file>`          Ending service

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

 

Centos下安装最新版Mono并为windwos服务配置开机启动项

标签:mission   redirect   bsp   .exe   查看   kconfig   arch   最新   art   

原文地址:http://www.cnblogs.com/skymyyang/p/7802789.html


评论


亲,登录后才可以留言!