crunchstat: fix typos in comments and help/error text.
[arvados.git] / services / crunchstat / crunchstat.go
index d61871da6475dcdde342789069492e9e8dcfedf2..7adfaaa67879d78288b24306410d14c0f02f5670 100644 (file)
@@ -149,7 +149,7 @@ func PollCgroupStats(cgroup_root string, cgroup_parent string, container_id stri
                                user_diff := next_user - last_user
                                sys_diff := next_sys - last_sys
                                // Assume we're reading stats based on 100
-                               // jiffies per second.  Because the ellaspsed
+                               // jiffies per second.  Because the elapsed
                                // time is in milliseconds, we need to boost
                                // that to 1000 jiffies per second, then boost
                                // it by another 100x to get a percentage, then
@@ -241,7 +241,7 @@ func main() {
        logger := log.New(os.Stderr, "crunchstat: ", 0)
 
        if cgroup_root == "" {
-               logger.Fatal("Must provide either -cgroup-root")
+               logger.Fatal("Must provide -cgroup-root")
        }
 
        // Make output channel
@@ -262,6 +262,10 @@ func main() {
 
                logger.Print("Running ", flag.Args())
 
+               // Child process will read from our stdin pipe (we
+               // close our copy below)
+               cmd.Stdin = os.Stdin
+
                // Forward SIGINT and SIGTERM to inner process
                term := make(chan os.Signal, 1)
                go func(sig <-chan os.Signal) {
@@ -293,6 +297,9 @@ func main() {
                }
        }
 
+       // Close standard input in this (parent) process
+       os.Stdin.Close()
+
        // Read the cid file
        var container_id string
        if cgroup_cidfile != "" {