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


    一:安装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 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:<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:如果给为在安装和配置过程中有任何疑问,望留言。

  • 相关阅读:
    验车流程
    WLK毁灭术士天赋图及输出手法
    一个类型集合操作SYS_REFCURSOR的例子
    关于法师真正的输出手法个人观点
    FS技能快界键的设置
    MODEL函数的简单用法。
    kevin的黎明十分
    Android9.0动态运行时权限源码分析及封装改造<四>打造自己的权限申请框架下
    电子书资源
    批量消除图片的杂色背景
  • 原文地址:https://www.cnblogs.com/skymyyang/p/7802789.html
Copyright © 2020-2023  润新知