推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
arthur8845
V2EX  ›  Python

superviosr[program:x] section里user参数的设置

  •  
  •   arthur8845 ·
    largetalk · Jul 5, 2012 · 4917 views
    This topic created in 5196 days ago, the information mentioned may be changed or developed.
    问题是这样的, 我要用supervisor来起 redmine。
    如果不用supervisor, 我起redmine命令是

    source ~/.rvm/scripts/rvm
    unicon_rails -E production -p 3000 -D

    我rvm是装在我这个用户下的,比如abc用户吧

    superviosr 里设置 user=abc, supervisor是先以root用户执行command,然后setuid=abc

    问题就是在这里了, root用户去执行 source /home/abc/.rvm/scripts/rvm 也是会报错的,

    请问有不重装 rvm,redmine的解决办法么。
    3 replies  •  1970-01-01 08:00:00 +08:00
    spritevan
        1
    spritevan  
       Jul 5, 2012
    arthur8845
        2
    arthur8845  
    OP
       Jul 5, 2012
    program 的执行用户改了是没有用的,我上面设置user就是设置program的执行用户

    supervisord启动用户改起来比较难,或者说不能改, 因为还有其他的启动项,如redis等
    9hills
        3
    9hills  
       Sep 9, 2012
    试试rvm wrapper:
    比如我想让gollum通过supervisord开机启动,那么首先
    rvm wrapper 1.9.3 startup gollum
    然后再supervisord的配置中加入
    [program:gollum]
    ;; need: rvm wrapper 1.9.3 startup gollum
    command=/home/cynic/.rvm/bin/startup_gollum
    directory=/home/cynic/Projects/wiki
    user=cynic
    environment=PATH=/home/cynic/.virtualenvs/python27/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin

    env是因为gollum要用virtualenv中的python2.7,你这个可以不加
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2487 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 04:41 · PVG 12:41 · LAX 21:41 · JFK 00:41
    ♥ Do have faith in what you're doing.