# 有很多费劲的都弄好了!
## 自启动神器:supervisor
### 安装:
安装python-setuptools
安装supervisor
### 配置:
echo_supervisord_conf > /etc/supervisord.conf
也可以用supervisor -c 导入指定位置的配置,这个据说更安全!
``` c++
//内部设置
//自启动我的mongodb和leanote
[program:mongodb]
command=mongod --dbpath /home/yourname/db
directory=/usr/bin
autorestart=true
redirect_stderr=true
[program:leanote]
command=bash /home/yourname/leanote/bin/run.sh
directory=/home/yourname/leanote/bin/
autorestart=true
redirect_stderr=true
```
### 常用命令:
supervisor可以查看由他启动的进程状态等信息,还可以在内部启动其控制的进程
supervisord是守护进程,一般不需要自己手动
supervisorctl是控制进程,子命令:
supervisorctl reload:重载配置
supervisorctl start all:可以启动所有进程
## mongodb
mongodb -repair???//不记得了!
这个问题比较多,不过还是解决了。
自启动非常郁闷,总是按照他的方法启动,最后找到了,有非常多的启动项。。。
如下:
- /etc/init/mongodb.conf
- /etc/init.d/mongod
- /etc/systemd/system/multi-user.target.wants/mongdb.service
- /etc/r0.d/K02mongodb
- /etc/r1.d/K02mongodb
- /etc/r2.d/S01mongodb
- /etc/r3.d/S01mongodb
- /etc/r4.d/S01mongodb
- /etc/r5.d/S01mongodb
- /etc/r6.d/K02mongodb
----------
## 相关参考链接:
[链接](http://huangketech.com/kai-yuan-de-bi-ji-guan-li-ruan-jian-leanoteda-jian/) 123
[链接标题](http://huangketech.com/kai-yuan-de-bi-ji-guan-li-ruan-jian-leanoteda-jian/)
[链接标题](https://github.com/leanote/leanote/wiki)
[链接标题](https://github.com/leanote/leanote/wiki/Leanote-%E6%BA%90%E7%A0%81%E7%89%88%E8%AF%A6%E7%BB%86%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B----Mac-and-Linux)
[链接标题](https://github.com/leanote/leanote/wiki/QA#%E5%A6%82%E4%BD%95%E7%BB%91%E5%AE%9A%E5%9F%9F%E5%90%8D)
[链接标题](https://segmentfault.com/a/1190000004000321) 222
[222](https://segmentfault.com/a/1190000004000321)
----------
没有评论:
发表评论