Add 12.3.md syntax highlighting

This commit is contained in:
vCaesar
2016-12-18 16:54:13 +08:00
parent 0b45cdad83
commit 342487e469

View File

@@ -7,6 +7,8 @@
- MarGo的一个实现思路使用Commond来执行自身的应用如果真想实现那么推荐这种方案
```Go
d := flag.Bool("d", false, "Whether or not to launch in the background(like a daemon)")
if *d {
cmd := exec.Command(os.Args[0],
@@ -32,8 +34,10 @@
cmd.Process.Kill()
}
}
```
- 另一种是利用syscall的方案但是这个方案并不完善
```Go
package main
@@ -103,7 +107,8 @@
return 0
}
```
上面提出了两种实现Go的daemon方案但是我还是不推荐大家这样去实现因为官方还没有正式的宣布支持daemon当然第一种方案目前来看是比较可行的而且目前开源库skynet也在采用这个方案做daemon。
## Supervisord
@@ -121,6 +126,8 @@ Supervisord可以通过`sudo easy_install supervisor`安装,当然也可以通
### Supervisord配置
Supervisord默认的配置文件路径为/etc/supervisord.conf通过文本编辑器修改这个文件下面是一个示例的配置文件
```conf
;/etc/supervisord.conf
[unix_http_server]
file = /var/run/supervisord.sock
@@ -161,6 +168,7 @@ Supervisord默认的配置文件路径为/etc/supervisord.conf通过文本编
redirect_stderr = true
stdout_logfile = /var/log/supervisord/blogdemon.log
```
### Supervisord管理
Supervisord安装完成后有两个可用的命令行supervisor和supervisorctl命令使用解释如下