示例#1
0
// stop runs 'vagrant suspend'
func stop(ccmd *cobra.Command, args []string) {

	// PreRun: initialize

	//
	if err := vagrant.Suspend(); err != nil {
		vagrant.Fatal("[commands/stop] vagrant.Suspend() failed", err.Error())
	}

	// boot the machine normally (not backgrounded) on next command
	config.VMfile.BackgroundIs(false)
}
示例#2
0
// halt
func halt(ccmd *cobra.Command, args []string) {

	//
	server.Unlock()

	//

	if err := server.Suspend(); err != nil {
		config.Fatal("[commands/halt] server.Suspend() failed", err.Error())
	}

	//
	if err := vagrant.Suspend(); err != nil {
		config.Fatal("[commands/halt] vagrant.Suspend() failed", err.Error())
	}

	//
	// os.Exit(0)
}