update
This commit is contained in:
+1
-2
@@ -15,7 +15,7 @@ import (
|
|||||||
|
|
||||||
var BeforeStop = []func(){}
|
var BeforeStop = []func(){}
|
||||||
|
|
||||||
var pidf = "/var/run/sillyGirl.pid"
|
var pidf = "/var/run/" + pname + ".pid"
|
||||||
|
|
||||||
func Daemon() {
|
func Daemon() {
|
||||||
for _, bs := range BeforeStop {
|
for _, bs := range BeforeStop {
|
||||||
@@ -62,7 +62,6 @@ func GitPull(filename string) (bool, error) {
|
|||||||
func CompileCode() error {
|
func CompileCode() error {
|
||||||
|
|
||||||
cmd := exec.Command("sh", "-c", "cd "+ExecPath+" && go build -o "+pname)
|
cmd := exec.Command("sh", "-c", "cd "+ExecPath+" && go build -o "+pname)
|
||||||
NotifyMasters(os.Args[0] + " " + pname)
|
|
||||||
_, err := cmd.Output()
|
_, err := cmd.Output()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.New("编译失败:" + err.Error() + "。")
|
return errors.New("编译失败:" + err.Error() + "。")
|
||||||
|
|||||||
+2
-2
@@ -232,8 +232,8 @@ func initSys() {
|
|||||||
service := `
|
service := `
|
||||||
[Service]
|
[Service]
|
||||||
Type=forking
|
Type=forking
|
||||||
ExecStart=` + ExecPath + "/sillyGirl" + ` -d
|
ExecStart=` + ExecPath + "/" + pname + ` -d
|
||||||
PIDFile=/var/run/sillyGirl.pid
|
PIDFile=/var/run/` + pname + `.pid
|
||||||
Restart=always
|
Restart=always
|
||||||
User=root
|
User=root
|
||||||
Group=root
|
Group=root
|
||||||
|
|||||||
Reference in New Issue
Block a user