diff --git a/service.go b/service.go index 8d4f61e..ed8a927 100644 --- a/service.go +++ b/service.go @@ -250,9 +250,9 @@ type Service interface { // greater rights. Will return an error if it is already installed. Install() error - // Remove removes the given service from the OS service manager. This may require + // Uninstall removes the given service from the OS service manager. This may require // greater rights. Will return an error if the service is not present. - Remove() error + Uninstall() error // Opens and returns a system logger. If the user program is running // interactively rather then as a service, the returned logger will write to @@ -270,7 +270,7 @@ type Service interface { } // ControlAction list valid string texts to use in Control. -var ControlAction = [5]string{"start", "stop", "restart", "install", "remove"} +var ControlAction = [5]string{"start", "stop", "restart", "install", "uninstall"} // Control issues control functions to the service from a given action string. func Control(s Service, action string) error { @@ -285,7 +285,7 @@ func Control(s Service, action string) error { case ControlAction[3]: err = s.Install() case ControlAction[4]: - err = s.Remove() + err = s.Uninstall() default: err = fmt.Errorf("Unknown action %s", action) } diff --git a/service_darwin.go b/service_darwin.go index 2f08d35..94d847c 100644 --- a/service_darwin.go +++ b/service_darwin.go @@ -124,7 +124,7 @@ func (s *darwinLaunchdService) Install() error { return t.Execute(f, to) } -func (s *darwinLaunchdService) Remove() error { +func (s *darwinLaunchdService) Uninstall() error { s.Stop() confPath, err := s.getServiceFilePath() diff --git a/service_linux.go b/service_linux.go index d490e5e..14a74bb 100644 --- a/service_linux.go +++ b/service_linux.go @@ -224,7 +224,7 @@ func (s *linuxService) Install() error { return nil } -func (s *linuxService) Remove() error { +func (s *linuxService) Uninstall() error { if flavor == initSystemd { exec.Command("systemctl", "disable", s.Name+".service").Run() } diff --git a/service_windows.go b/service_windows.go index 6c9fa74..09ebbed 100644 --- a/service_windows.go +++ b/service_windows.go @@ -179,7 +179,7 @@ func (ws *windowsService) Install() error { return nil } -func (ws *windowsService) Remove() error { +func (ws *windowsService) Uninstall() error { m, err := mgr.Connect() if err != nil { return err