第一次写wiki,不知道这样写是否妥当,请多多指教!

ilvsx 2014-06-23 03:53:25 -07:00
parent cd2242a1ac
commit a3a5d48dbe

@ -1,6 +1,62 @@
如果你想在后台运行 Shadowsocks可以使用 supervisor。
以 Debian 7.0 为例:
Supervisor是一个C/S系统,它可以在类UNIX系统上控制系统进程由python编写它提供了大量的功能来实现对进程的管理。
###安装
- pip
pip install supervisor
- easy_install
easy_install supervisor
- apt-get (Debian/Ubuntu)
apt-get update
apt-get install supervisor
#默认配置文件在`/etc/supervisor/supervisord.conf`
- yum (Centos)
yum install supervisor
###创建配置文件
安装完成后,使用下面两种方式之一创建默认配置文件:
- 默认路径(`apt-get`方式在`/etc/supervisor/supervisord.conf`)
echo_supervisord_conf > /etc/supervisord.conf
#supervisord程序在运行后会自动查找并加载此目录配置文件
- 指定路径
echo_supervisord_conf > "指定路径"/supervisord.conf
#supervisord程序使用-c参数在启动时手动指定配置文件`supervisord -c "指定路径"/supervisord.conf`
###添加shadowsocks
编辑配置文件supervisord.conf在后面添加
[program:shadowsocks]
command=ssserver -c /etc/shadowsocks.json
autostart=true
autorestart=true
user=nobody
###启动
- 默认路径配置启动:`supervisord`
- 指定路径配置启动:`supervisord -c "指定路径"/supervisord.conf`
###常用命令
- 获得所有程序状态 `supervisorctl status`
- 关闭目标程序 `supervisorctl stop ssserver`
- 启动目标程序 `supervisorctl start ssserver`
- 关闭所有程序 `supervisorctl shutdown`
---
###以 Debian 7.0 为例
执行
```