Beispiel #1
0
func bootNewCommand(slaveNode *processtree.SlaveNode, command string, err error) (*unixsocket.Usock, error) {
	if err != nil {
		return nil, err
	}

	request := &processtree.CommandRequest{command, make(chan *os.File)}
	slaveNode.RequestCommandBoot(request)
	commandFile := <-request.Retchan // TODO: don't really want to wait indefinitely.
	// defer commandFile.Close() // TODO: can't do this here anymore.

	return unixsocket.NewUsockFromFile(commandFile)
}
Beispiel #2
0
func bootNewCommand(slaveNode *processtree.SlaveNode, command string, err error) (*unixsocket.Usock, error) {
	if err != nil {
		return nil, err
	}

	request := &processtree.CommandRequest{Name: command, Retchan: make(chan *processtree.CommandReply)}
	slaveNode.RequestCommandBoot(request)
	reply := <-request.Retchan // TODO: don't really want to wait indefinitely.
	// defer commandFile.Close() // TODO: can't do this here anymore.

	if reply.State == processtree.SCrashed {
		return nil, errors.New("Process has crashed")
	}

	return unixsocket.NewFromFile(reply.File)
}