zoukankan      html  css  js  c++  java
  • 新建uwsgi的service服务

    1.cd到/etc/init.d

    创建一个uwsgi文件,修改权限 chmod 775 mongodb 

    2.编辑该文件

    #!/bin/sh
      
    ### BEGIN INIT INFO
    # Provides:       nginx
    # Required-Start:    $local_fs $remote_fs $network $syslog $named
    # Required-Stop:     $local_fs $remote_fs $network $syslog $named
    # Default-Start:     2 3 4 5
    # Default-Stop:      0 1 6
    # Short-Description: starts the nginx web server
    # Description:       starts nginx using start-stop-daemon
    ### END INIT INFO
    
    UWSGI_INI="/etc/uwsgi/uwsgi.ini"
    startuwsgi(){
            uwsgi --ini ${UWSGI_INI}
    }
    stopuwsgi(){
            PIDFILE=`cat ${UWSGI_INI} |grep pidfile|cut -d '=' -f 2`
            kill -9 `cat ${PIDFILE}`
            rm -f ${PIDFILE}
    }
    case "$1" in
            start)
                    startuwsgi
                    ;;
            stop)
                    stopuwsgi
                    ;;
            restart)
                    stopuwsgi
                    startuwsgi
                    ;;
            *)
                    echo "uwsgi: $NAME {start|stop|restart}">&2
                    exit 3
    esac

    3.加入到系统启动中

    // 添加到系统启动
    update-rc.d uwsgi defaults 
    // 从系统启动中删除
    update-rc.d uwsgi remove

    4.输入上面启动命令

    service uwsgi restart
  • 相关阅读:
    移动端调试解决方案-转载
    移动端调试工具-Weinre
    css颜色大全-转载
    目录
    多版本python import 问题解决方案
    annoy安装
    word2vec
    GBDT
    Adaptive Boosting
    融合模型Aggregation
  • 原文地址:https://www.cnblogs.com/dsynb/p/13306198.html
Copyright © 2011-2022 走看看