service: rename Service.Remove to Service.Uninstall.
This commit is contained in:
+4
-4
@@ -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)
|
||||
}
|
||||
|
||||
+1
-1
@@ -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()
|
||||
|
||||
+1
-1
@@ -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()
|
||||
}
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user