Go fmt
This commit is contained in:
parent
ae99cfc014
commit
aba9b67e9a
22
main.go
22
main.go
@ -144,17 +144,17 @@ func processCommand(cmd string) error {
|
||||
start := time.Now()
|
||||
if verb == "restart" || verb == "stop" {
|
||||
f, err := os.OpenFile(fmt.Sprintf("/proc/%d/ctl", services[svc].ProcessHandle.Pid), os.O_WRONLY, 0660)
|
||||
if err != nil {
|
||||
log.Printf("")
|
||||
}
|
||||
defer f.Close()
|
||||
_, err = f.WriteString("kill")
|
||||
if err != nil {
|
||||
log.Printf(DAEMON_CTL_FAILED, err, time.Since(start))
|
||||
} else {
|
||||
delete(services, svc)
|
||||
log.Printf(DAEMON_CTL_PROCESSED, svc, time.Since(start))
|
||||
}
|
||||
if err != nil {
|
||||
log.Printf("")
|
||||
}
|
||||
defer f.Close()
|
||||
_, err = f.WriteString("kill")
|
||||
if err != nil {
|
||||
log.Printf(DAEMON_CTL_FAILED, err, time.Since(start))
|
||||
} else {
|
||||
delete(services, svc)
|
||||
log.Printf(DAEMON_CTL_PROCESSED, svc, time.Since(start))
|
||||
}
|
||||
}
|
||||
if verb == "restart" || verb == "start" {
|
||||
startup, err := readLines(serviceFile)
|
||||
|
@ -3,10 +3,10 @@ package main
|
||||
var (
|
||||
DAEMON_START = "Starting headless9"
|
||||
CMD_SYNTAX = "Command structure: \"headless9 $verb $service\""
|
||||
CTL_UNABLE_WRITE = "Unable to write to Control Socket. Please check the file %+v and that it's permissions are 700"
|
||||
CTL_NOT_OPEN = "Unable to open Control Socket. Please check the file %+v and that it's permissions are 700"
|
||||
CTL_NOT_CLEAR = "Unable to clear Control Socket. Please check the file %+v and that it's permissions are 700"
|
||||
CTL_NOT_REWOUND = "Unable to rewind Control Socket. Please check the file %+v and that it's permissions are 700"
|
||||
CTL_UNABLE_WRITE = "Unable to write to Control Socket. Please check the file %+v and that it's permissions are 660"
|
||||
CTL_NOT_OPEN = "Unable to open Control Socket. Please check the file %+v and that its permissions are 660"
|
||||
CTL_NOT_CLEAR = "Unable to clear Control Socket. Please check the file %+v and that its permissions are 660"
|
||||
CTL_NOT_REWOUND = "Unable to rewind Control Socket. Please check the file %+v and that its permissions are 660"
|
||||
DAEMON_FILE_REFRESH = "Refreshing controlFile %+v"
|
||||
DAEMON_SVC_INVALID = "Invalid command `%v`, skipping. Args: { %+v }"
|
||||
DAEMON_SVC_DISABLED = "%+v is disabled, skipping!"
|
||||
|
Loading…
Reference in New Issue
Block a user