Merge branch 'master' into f-port-configs

This commit is contained in:
Chris Bednarski
2015-09-23 11:57:12 -07:00
52 changed files with 1069 additions and 278 deletions

View File

@@ -9,7 +9,9 @@ import (
"os/exec"
"path"
"path/filepath"
"runtime"
"strings"
"syscall"
"time"
"github.com/hashicorp/nomad/client/config"
@@ -36,6 +38,12 @@ func NewJavaDriver(ctx *DriverContext) Driver {
}
func (d *JavaDriver) Fingerprint(cfg *config.Config, node *structs.Node) (bool, error) {
// Only enable if we are root when running on non-windows systems.
if runtime.GOOS != "windows" && syscall.Geteuid() != 0 {
d.logger.Printf("[DEBUG] driver.java: must run as root user, disabling")
return false, nil
}
// Find java version
var out bytes.Buffer
var erOut bytes.Buffer