mirror of
https://github.com/gotoeasy/glogcenter.git
synced 2025-09-15 12:58:34 +08:00
修复:docker方式启动特殊处理
This commit is contained in:
parent
6fc6908abf
commit
93704223d6
@ -15,10 +15,12 @@ import (
|
||||
func init() {
|
||||
|
||||
// 命令行参数解析,【-d】后台方式启动,【stop】停止,【restart】重启,【-v/version/--version/-version】查看版本
|
||||
// 内部用特殊参数,提示docker方式启动【--docker】固定为非后台方式
|
||||
daemon := false
|
||||
stop := false
|
||||
restart := false
|
||||
version := false
|
||||
docker := false
|
||||
for index, arg := range os.Args {
|
||||
if index == 0 {
|
||||
continue
|
||||
@ -32,6 +34,9 @@ func init() {
|
||||
if arg == "restart" {
|
||||
restart = true
|
||||
}
|
||||
if arg == "--docker" {
|
||||
docker = true
|
||||
}
|
||||
if arg == "-v" || arg == "version" || arg == "--version" || arg == "-version" {
|
||||
version = true
|
||||
}
|
||||
@ -53,6 +58,11 @@ func init() {
|
||||
os.MkdirAll(conf.GetStorageRoot(), 0766)
|
||||
}
|
||||
|
||||
// docker方式启动
|
||||
if docker {
|
||||
return
|
||||
}
|
||||
|
||||
// pid 目录、文件
|
||||
pidpath := "."
|
||||
pidfile := "glc.pid"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user