Browse Source

Go fmt

master
Gregory Rudolph 2 years ago
parent
commit
aba9b67e9a
Signed by: rudi
GPG Key ID: EF64F3CBD1A1EBDD
  1. 22
      main.go
  2. 8
      strings.go

22
main.go

@ -144,17 +144,17 @@ func processCommand(cmd string) error { @@ -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)

8
strings.go

@ -3,10 +3,10 @@ package main @@ -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…
Cancel
Save