zoukankan      html  css  js  c++  java
  • Permession denied error when use supervisorctl

    i am use supervisor + flask + gunicorn + virtalenv to deply my app, when i use supervisorctl, it shows me the error:

    error: <class 'socket.error'>, [Errno 13] Permission denied: file: /usr/lib/python2.7/socket.py line: 224

    this is supervisor.conf

    [inet_http_server]
    port=127.0.0.1:9001
    username=xxx
    password=xxxx

    [supervisord]
    logfile=/tmp/supervisord.log
    logfile_maxbytes=10MB
    logfile_backups=10
    loglevel=info
    pidfile=/tmp/supervisord.pid
    user=wwwuser

    [supervisorctl]
    serverurl=http://127.0.0.1:9001
    username=xxx
    password=xxx

    [program:xxxxxxxxx]
    command=gunicorn -w 4 -k gevent -p /tmp/site.pid -b 127.0.0.1:6000 manage:app
    process_name=%(program_name)s
    numprocs=1
    directory=/home/wwwuser/site
    autostart=true
    user=wwwuser
    redirect_stderr=true
    stdout_logfile=/tmp/site-out.log
    stdout_logfile_maxbytes=1MB
    stdout_logfile_backups=10
    stderr_logfile=/tmp/site-err.log
    stderr_logfile_maxbytes=1MB
    stderr_logfile_backups=10

    =================================================

    in your supervisord.conf you can do something like the following

    just make it writable for all

    [unix_http_server]
    file=/tmp/supervisor.sock   ; (the path to the socket file)
    chmod=0766                 ; socket file mode (default 0700)
    

    controll who actually owns the file

    [unix_http_server]
    file=/tmp/supervisor.sock   ; (the path to the socket file)
    chmod=0760                 ; socket file mode (default 0700)
    chown=myuser:group       ; socket file uid:gid owner
    

    this last one im not sure as i have not tested and i dont completely understand behavior here. I also dont care cause It doesnt look very safe:

    [unix_http_server]
    file=/tmp/supervisor.sock   ; (the path to the socket file)
    chmod=0700                ; socket file mode (default 0700)
    username=root              ; (default is no username (open server))
    password=yourrootpassword               ; (default is no password (open server))
  • 相关阅读:
    04_web基础(六)之请求转发与重定向
    04_web基础(五)之cookie与session
    04_web基础(四)之servlet详解
    04_web基础(三)之进一步理解web
    04_web基础(二)之web构建
    本地密码提取工具-LAZAGNE
    免杀工具汇总
    流量取证-提取文件
    CA证书安装以及sslh协议转发
    ssh 端口转发
  • 原文地址:https://www.cnblogs.com/turingbrain/p/6376448.html
Copyright © 2011-2022 走看看