Nomad check on custom plugin

From the doc:

Script checks are not supported for the QEMU driver since the Nomad client does not have access to the file system of a task for that driver.

I’m wondering what the relationship is between script checking and file system isolation.
The docker plugin has also defined FSIsolationImage and supports script checking.

I wrote a custom plugin with no isolation set and tried setting up a simple check that “exit 0”.

service {
    check {
        type     = "script"
        name     = "test check"
        command  = "/usr/bin/check-ok"
        interval = "60s"
        timeout  = "5s"
    }
}

Since I added this check, my service never reaches a running state and ultimately fails.
What am I doing wrong?

This is actually related to consul not nomad.

As a workaround I was registering my a service programmatically:

reg := &api.AgentServiceRegistration{
	ID:   "foo",
	Name: "bar",
	Meta: meta,
	Tags: []string{ "some", "tags" },
//	Check: &api.AgentServiceCheck{
//		Args:     []string{"sh", "-c", "true"},
//		Interval: "10s",
//	},
}

err := c.consul.Client().Agent().ServiceRegister(reg)

But then, again, adding this simple check make the service registration fails.

Quite confusing.

Ok so the issue was that I had to enable -enable-script-checks on the consul side :frowning: , now it works :slight_smile: .