10218: Added calls to "df -i" to record free i-nodes. Combined stdout and stderr...
[arvados.git] / services / crunch-run / crunchrun.go
index 63b63a16a235fb0dff91e4263853c0623e05a2e5..e0d707a5a538b7800c8ef70abaf7b618d3c3f321 100644 (file)
@@ -533,17 +533,29 @@ func (runner *ContainerRunner) LogNodeInfo() (err error) {
                },
                infoCommand{
                        label: "Disk Space",
-                       cmd:   []string{"df", "-m"},
+                       cmd:   []string{"df", "-m", "/"},
+               },
+               infoCommand{
+                       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") {