https://github.com/heng30/svrctl
golang 编写的简单进程起停控制
https://github.com/heng30/svrctl
Last synced: 6 months ago
JSON representation
golang 编写的简单进程起停控制
- Host: GitHub
- URL: https://github.com/heng30/svrctl
- Owner: Heng30
- Created: 2020-04-28T10:34:43.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-28T11:32:44.000Z (about 5 years ago)
- Last Synced: 2023-10-20T20:12:00.797Z (over 1 year ago)
- Language: Go
- Size: 1.95 KB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# svrctl 是 golang 编写的简单进程起停控制
## 主要功能:
- start: 启动程序,将pid写入/var/run/program_name.pid 文件
- stop: 发送SIGINT信号给正在运行的程序,退出程序
- restart: 重新启动程序
- daemon: 以后台方式启动程序## 注意:
程序会消耗掉 start, stop, restart, daemon 这四个参数## 例子
```go
package mainimport (
"github.com/Heng30/svrctl""time"
)func main() {
svrctl.Run()for true {
time.Sleep(time.Second)
}
}
```