// Exec a process in a bundle using 'runc exec'
Exec a process in a bundle using 'runc exec'
// Exec a process in a bundle using ' runc exec '
func (r *RunRunc) Exec(id string, spec garden.ProcessSpec, io garden.ProcessIO) (garden.Process, error) {
	mlog := plog.Start("exec", lager.Data{"id": id, "path": spec.Path})
	tmpFile, err := ioutil.TempFile("", "guardianprocess")
	if err != nil {
		return nil, mlog.Err("tempfile", err)
	}
	if err := writeProcessJSON(spec, tmpFile); err != nil {
		return nil, mlog.Err("encode", err)
	}
	cmd := r.runc.ExecCommand(id, tmpFile.Name())
	process, err := r.tracker.Run(r.pidGenerator.Generate(), cmd, io, spec.TTY, nil)
	if err != nil {
		return nil, mlog.Err("run", err)
	}
	mlog.Info("execed")
	return process, nil
}
func ( r * RunRunc ) Exec ( id string , spec garden . ProcessSpec , io garden . ProcessIO ) ( garden . Process , error ) { mlog := plog . Start ( " " , lager . Data { " " : id , " " : spec . Path } ) tmpFile , err := ioutil . TempFile ( " " , " " ) if err != nil { return nil , mlog . Err ( " " , err ) } if err := writeProcessJSON ( spec , tmpFile ) ; err != nil { return nil , mlog . Err ( " " , err ) } cmd := r . runc . ExecCommand ( id , tmpFile . Name ( ) ) process , err := r . tracker . Run ( r . pidGenerator . Generate ( ) , cmd , io , spec . TTY , nil ) if err != nil { return nil , mlog . Err ( " " , err ) } mlog . Info ( " " ) return process , nil }
Exec a process in a bundle using 'runc exec'
Exec a process in a bundle using ' runc exec '