Fix qemu check and add debug lines when a driver is disabled
This commit is contained in:
parent
bbb3853dd8
commit
dd2f16123f
|
@ -34,6 +34,7 @@ func NewExecDriver(ctx *DriverContext) Driver {
|
|||
func (d *ExecDriver) 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.exec: must run as root user, disabling")
|
||||
return false, nil
|
||||
}
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@ 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
|
||||
}
|
||||
|
||||
|
|
|
@ -54,9 +54,9 @@ func NewQemuDriver(ctx *DriverContext) Driver {
|
|||
}
|
||||
|
||||
func (d *QemuDriver) Fingerprint(cfg *config.Config, node *structs.Node) (bool, error) {
|
||||
// Only enable if we are root. This check also disables on Windows as
|
||||
// Geteuid() returns -1.
|
||||
if syscall.Geteuid() != 0 {
|
||||
// Only enable if we are root when running on non-windows systems.
|
||||
if runtime.GOOS != "windows" && syscall.Geteuid() != 0 {
|
||||
d.logger.Printf("[DEBUG] driver.qemu: must run as root user, disabling")
|
||||
return false, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue