From fb4f0c5a69924c74954888d14dc3d71ab755001e Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 27 Jun 2019 03:14:16 -0600 Subject: [PATCH] WIP creates valid userspace plist on os x --- .../installer/dist/Library/LaunchDaemons/_rdns_.plist.tmpl | 4 ++-- cmd/watchdog/installer/install.go | 5 +++++ cmd/watchdog/watchdog.go | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cmd/watchdog/installer/dist/Library/LaunchDaemons/_rdns_.plist.tmpl b/cmd/watchdog/installer/dist/Library/LaunchDaemons/_rdns_.plist.tmpl index 8971ccb..def0d04 100644 --- a/cmd/watchdog/installer/dist/Library/LaunchDaemons/_rdns_.plist.tmpl +++ b/cmd/watchdog/installer/dist/Library/LaunchDaemons/_rdns_.plist.tmpl @@ -9,15 +9,15 @@ {{- if .Interpreter }} {{ .Interpreter }} {{- end }} - {{ .Exec }} + {{ .Local }}/opt/{{ .Name }}/{{ .Exec }} {{- if .Argv }} {{- range $arg := .Argv }} {{ $arg }} {{- end }} {{- end }} - EnvironmentVariables {{- if .Envs }} + EnvironmentVariables {{- range $key, $value := .Envs }} {{ $key }} diff --git a/cmd/watchdog/installer/install.go b/cmd/watchdog/installer/install.go index d12afb5..5070f5f 100644 --- a/cmd/watchdog/installer/install.go +++ b/cmd/watchdog/installer/install.go @@ -59,5 +59,10 @@ func Install(c *Config) error { return err } + err = os.MkdirAll(c.LogDir, 0750) + if nil != err { + return err + } + return nil } diff --git a/cmd/watchdog/watchdog.go b/cmd/watchdog/watchdog.go index 5202b6b..f105ae8 100644 --- a/cmd/watchdog/watchdog.go +++ b/cmd/watchdog/watchdog.go @@ -21,6 +21,7 @@ func usage() { } func main() { + fmt.Println("Watchdog " + GitVersion) for i := range os.Args { switch { case strings.HasSuffix(os.Args[i], "version"):