10218: Added calls to "df -i" to record free i-nodes. Combined stdout and stderr...
authorLucas Di Pentima <lucas@curoverse.com>
Wed, 22 Mar 2017 19:07:37 +0000 (16:07 -0300)
committerLucas Di Pentima <lucas@curoverse.com>
Wed, 22 Mar 2017 19:07:37 +0000 (16:07 -0300)
services/crunch-run/crunchrun.go

index 3450345496ecff1a86e2c88b60ab29673ebbcf74..e0d707a5a538b7800c8ef70abaf7b618d3c3f321 100644 (file)
@@ -539,15 +539,23 @@ func (runner *ContainerRunner) LogNodeInfo() (err error) {
                        label: "Disk Space",
                        cmd:   []string{"df", "-m", os.TempDir()},
                },
+               infoCommand{
+                       label: "Disk INodes",
+                       cmd:   []string{"df", "-i", "/"},
+               },
+               infoCommand{
+                       label: "Disk INodes",
+                       cmd:   []string{"df", "-i", os.TempDir()},
+               },
        }
 
        // Run commands with informational output to be logged.
        var out []byte
        for _, command := range commands {
-               out, err = exec.Command(command.cmd[0], command.cmd[1:]...).Output()
+               out, err = exec.Command(command.cmd[0], command.cmd[1:]...).CombinedOutput()
                if err != nil {
-                       return fmt.Errorf("While running command '%s': %v",
-                               command.cmd[0], err)
+                       return fmt.Errorf("While running command %q: %v",
+                               command.cmd, err)
                }
                logger.Println(command.label)
                for _, line := range strings.Split(string(out), "\n") {