標籤:mission redirect bsp .exe 查看 kconfig arch 最新 art
一:安裝Mono,此步驟參照官網
1:配置Yum倉庫
#Centos 7
yum install yum-utilsrpm --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"yum-config-manager --add-repo http://download.mono-project.com/repo/centos7/
#Centos 6yum install yum-utilsrpm --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:remotingservicestart(){
#這裡面的-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" instart)start;;stop)stop;;restart)stopstart;; *)echo$"Usage: $0 {start|stop|restart}"exit 1esac
2:執行時service mfgRemotingServer stop 會遇到 env: /etc/init.d/mfgRemotingServer: Permission denied,解決辦法如下:
chmod +x /etc/init.d/mfgRemotingServerservice mfgRemotingServer stop#加入到開機啟動項chkconfig --add mfgRemotingServerchkconfig mfgRemotingServer on
3:mono-service的相關參數如下:
You must specify at least the assembly nameUsage 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/outputControlling 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服務配置開機啟動項