Exemplo n.º 1
0
func (v *CmdLaunchdAction) Run() error {
	switch v.action {
	case "start":
		return launchd.Start(v.label, v.G().Log)
	case "restart":
		return launchd.Restart(v.label, v.G().Log)
	case "stop":
		return launchd.Stop(v.label, true, v.G().Log)
	case "uninstall":
		return launchd.Uninstall(v.label, true, v.G().Log)
	}

	return nil
}
Exemplo n.º 2
0
func (v *CmdLaunchdAction) Run() error {
	switch v.action {
	case "start":
		return launchd.Start(v.label, defaultLaunchdWait, v.G().Log)
	case "restart":
		return launchd.Restart(v.label, defaultLaunchdWait, v.G().Log)
	case "stop":
		_, stopErr := launchd.Stop(v.label, defaultLaunchdWait, v.G().Log)
		return stopErr
	case "uninstall":
		return launchd.Uninstall(v.label, defaultLaunchdWait, v.G().Log)
	}

	return nil
}
Exemplo n.º 3
0
func NewCmdLaunchdUninstall(cl *libcmdline.CommandLine) cli.Command {
	return cli.Command{
		Name:         "uninstall",
		ArgumentHelp: "<label>",
		Usage:        "Uninstall a keybase launchd service",
		Action: func(c *cli.Context) {
			args := c.Args()
			if len(args) < 1 {
				G.Log.Fatalf("No label specified.")
			}
			err := launchd.Uninstall(args[0])
			if err != nil {
				G.Log.Fatalf("%v", err)
			}
			os.Exit(0)
		},
	}
}
Exemplo n.º 4
0
func NewCmdLaunchdUninstall(cl *libcmdline.CommandLine, g *libkb.GlobalContext) cli.Command {
	return cli.Command{
		Name:         "uninstall",
		ArgumentHelp: "<label>",
		Usage:        "Uninstall a keybase launchd service",
		Action: func(c *cli.Context) {
			// TODO: Use ChooseCommand
			args := c.Args()
			if len(args) < 1 {
				g.Log.Fatalf("No label specified.")
			}
			err := launchd.Uninstall(args[0], os.Stdout)
			if err != nil {
				g.Log.Fatalf("%v", err)
			}
			os.Exit(0)
		},
	}
}
Exemplo n.º 5
0
func uninstallKBFSServices(g *libkb.GlobalContext, runMode libkb.RunMode) error {
	err1 := launchd.Uninstall(AppKBFSLabel.labelForRunMode(runMode), true, nil)
	err2 := launchd.Uninstall(BrewKBFSLabel.labelForRunMode(runMode), true, nil)
	return libkb.CombineErrors(err1, err2)
}
Exemplo n.º 6
0
func uninstallKBFSServices(runMode libkb.RunMode) {
	launchd.Uninstall(AppKBFSLabel.labelForRunMode(runMode), os.Stdout)
	launchd.Uninstall(BrewKBFSLabel.labelForRunMode(runMode), os.Stdout)
}
Exemplo n.º 7
0
// Uninstall keybase all services for this run mode.
func uninstallKeybaseServices(runMode libkb.RunMode) {
	launchd.Uninstall(AppServiceLabel.labelForRunMode(runMode), os.Stdout)
	launchd.Uninstall(BrewServiceLabel.labelForRunMode(runMode), os.Stdout)
}
Exemplo n.º 8
0
func uninstallUpdater(runMode libkb.RunMode, log Log) error {
	return launchd.Uninstall(DefaultUpdaterLabel(runMode), defaultLaunchdWait, log)
}
Exemplo n.º 9
0
func uninstallKBFSServices(runMode libkb.RunMode, log Log) error {
	err1 := launchd.Uninstall(defaultKBFSLabel(runMode, false), defaultLaunchdWait, log)
	err2 := launchd.Uninstall(defaultKBFSLabel(runMode, true), defaultLaunchdWait, log)
	return libkb.CombineErrors(err1, err2)
}