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
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
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) {
}
}
+ // Close standard input in this (parent) process
+ os.Stdin.Close()
+
// Read the cid file
var container_id string
if cgroup_cidfile != "" {