From d174b4739f0a10a452124405a95ef77fe2449c0b Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 5 Nov 2020 16:05:47 -0700 Subject: [PATCH] bugfix service installers --- cmd/telebit/telebit.go | 2 +- internal/service/launchctl_darwin.go | 4 ++-- internal/service/other.go | 2 +- internal/service/svc_windows.go | 4 ++-- internal/service/systemd_linux.go | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/telebit/telebit.go b/cmd/telebit/telebit.go index 3aea85c..d72ae62 100644 --- a/cmd/telebit/telebit.go +++ b/cmd/telebit/telebit.go @@ -99,7 +99,7 @@ func main() { if len(os.Args) >= 2 { if "install" == os.Args[1] { - if err := service.Install(); nil != err { + if err := service.Install(serviceName, serviceDesc); nil != err { fmt.Fprintf(os.Stderr, "%v", err) } return diff --git a/internal/service/launchctl_darwin.go b/internal/service/launchctl_darwin.go index dc784d6..5d2507e 100644 --- a/internal/service/launchctl_darwin.go +++ b/internal/service/launchctl_darwin.go @@ -5,6 +5,6 @@ import ( ) // Install ensures a systemd service is active -func Install() error { - return errors.New("'install' not supported for system services on this platform") +func Install(name, desc string) error { + return errors.New("not supported for system services on this platform") } diff --git a/internal/service/other.go b/internal/service/other.go index d7ad0b4..4f4d1d4 100644 --- a/internal/service/other.go +++ b/internal/service/other.go @@ -7,6 +7,6 @@ import ( ) // Install ensures a windows service is active -func Install() error { +func Install(name, desc string) error { return errors.New("not supported for system services on this platform") } diff --git a/internal/service/svc_windows.go b/internal/service/svc_windows.go index 131120c..c0ab48e 100644 --- a/internal/service/svc_windows.go +++ b/internal/service/svc_windows.go @@ -17,7 +17,7 @@ func Install(name, desc string) error { return err } - return installService(name, desc, exepath) + return install(name, desc, exepath) } func getExecPath(exepath string) (string, error) { @@ -38,7 +38,7 @@ func getExecPath(exepath string) (string, error) { p += ".exe" fi, err = os.Stat(p) if nil != err { - return err + return "", err } } diff --git a/internal/service/systemd_linux.go b/internal/service/systemd_linux.go index dc784d6..9395803 100644 --- a/internal/service/systemd_linux.go +++ b/internal/service/systemd_linux.go @@ -5,6 +5,6 @@ import ( ) // Install ensures a systemd service is active -func Install() error { +func Install(name, desc string) error { return errors.New("'install' not supported for system services on this platform") }