Mac 下 Supervisor 的安装与配置
1: brew install pythonsudopip installsupervisor
2: 在/etc下创建supervisord.conf
并编辑内容如下:
port = 127.0.0.1:9001
username = dhq
password = 123456
file = /tmp/supervisor.sock
chmod = 0700
logfile = /Users/yuan/.supervisor/supervisord.log
logfile_maxbytes = 50MB
logfile_backups=10
loglevel = info
pidfile = /tmp/supervisord.pid
nodaemon = False
minfds = 1024
minprocs = 200
umask = 022
identifier = supervisor
directory = /tmp
nocleanup = true
childlogdir = /tmp
serverurl = unix:///tmp/supervisor.sock
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
directory = /Users/yuan/shadowsocks
command = /usr/bin/python /Users/yuan/shadowsocks/local.py
autostart = true
autorestart = true
3: 启动 supervisor
supervisord -c /etc/supervisord.conf
4: 把 supervisord 加入系统启动服务
4.1:在/Library/LaunchDaemons 下创建com.agendaless.supervisord.plist文件,
4.2:编辑内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<false/>
</dict>
<key>Label</key>
<string>dengjoe.supervisord</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/supervisord</string>
<string>-n</string>
<string>-c</string>
<string>/etc/supervisord.conf</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
4.3:启动supervisord服务: launchctl load ~/Library/LaunchAgents/dengjoe.supervisord.plist
参考文章: https://medium.com/@canburak/daemons-for-a-developer-on-mac-os-d410b8390fac
http://dhq.me/mac-supervisor-install
https://nicksergeant.com/running-supervisor-on-os-x/
页:
[1]