zoukankan      html  css  js  c++  java
  • 在Linux CentOS7下设置netcore Net5 项目开机自启

    在Linux CentOS7下设置netcore Net5 项目开机自启

    一、创建文件

    在etc/systemd/system下创建xxx.service文件

    例如:
    vi /etc/systemd/system/ubif.service

    二、编辑文件

    内容如下:

    [Unit]
    Description="ubif Service"      
    
    [Service]
    Type=simple
    GuessMainPID=true
    WorkingDirectory=/var/ubif/UbifPublish/                                            //项目路径
    StandardOutput=journal
    StandardError=journal
    ExecStart=/usr/bin/dotnet UBIF.Web.dll                                           //启动指令
    Restart=always
    
    [Install]
    WantedBy=multi-user.target

    三、添加到自启

    cd /etc/systemd/system/
    
    systemctl enable ubif.service

    四、启动服务

    systemctl start ubif.service

    五、服务状态

    systemctl status ubif.service  //查看服务
    systemctl start ubif.service //启动服务
    systemctl restart ubif.service //重启服务
    systemctl stop ubif.service //停止服务
    © 版权声明 文章版权归作者所有,若需转载,请在显著位置标志该文章地址。
  • 相关阅读:
    css优化篇
    select超全超详细总结篇
    meta总结
    富文本编辑
    textarea 换行处理
    07 DRF响应类:Response
    06 内部类
    05 序列化组件
    04 APIView的请求生命周期
    python中if __name__ == '__main__'是什么?
  • 原文地址:https://www.cnblogs.com/luchenglong/p/14500312.html
Copyright © 2011-2022 走看看