From 73ad8dad12469c87ba023d0c32de081f79b98cf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Meireles?= Date: Tue, 5 Jan 2016 14:08:48 +0000 Subject: [PATCH 1/2] hard kill VMs that didn't managed to get an IP addr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: António Meireles --- run.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/run.go b/run.go index bd16c0a..2912b70 100644 --- a/run.go +++ b/run.go @@ -228,6 +228,9 @@ func (running *sessionContext) boot(slt int, rawArgs *viper.Viper) (err error) { for { select { case <-time.After(30 * time.Second): + if p, ee := os.FindProcess(c.Process.Pid); ee == nil { + p.Kill() + } vm.errch <- fmt.Errorf("Unable to grab VM's pid and IP after " + "30s (!)... Aborting") return From e6d184a8259f258043321f0b7d18486ad4dcc783 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Meireles?= Date: Tue, 5 Jan 2016 14:09:21 +0000 Subject: [PATCH 2/2] revert to whatever was in /etc/exports if checkexports fails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: António Meireles --- run.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/run.go b/run.go index 2912b70..42dbe48 100644 --- a/run.go +++ b/run.go @@ -378,6 +378,8 @@ func nfsSetup() (err error) { if err = cmd.Run(); err != nil { err = fmt.Errorf("unable to validate %s (see above)", exportsF) + // getting back to where we were + ioutil.WriteFile(exportsF, buf, os.ModeAppend) } return }()