Centos下安裝最新版Mono並為windwos服務配置開機啟動項

來源:互聯網
上載者:User

標籤: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服務配置開機啟動項

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.