Dear Nomad community,
I have a nomad + consul cluster and trying to run the following raw_exec job
variable "datacenter" {
type = string
}
job "munge" {
priority = 95 # 100 is higher priority
datacenters = ["${var.datacenter}"]
type = "system"
group "munge" {
restart {
attempts = 50
delay = "15s"
interval = "30m"
mode = "fail"
}
task "setup" {
lifecycle {
hook = "prestart"
sidecar = false
}
driver = "raw_exec"
user = "root"
config {
command = "bash"
args = ["-c", "zypper install --no-confirm --no-recommends munge munge-libs munge-devel && mkdir -p /var/run/munge && chown -R munge:munge /var/run/munge && chmod -R 0755 /var/run/munge"]
}
}
task "munge" {
driver = "raw_exec"
user = "munge"
config {
command = "/usr/sbin/munged"
args = ["--foreground"]
}
}
task "remove" {
lifecycle {
hook = "poststop"
sidecar = false
}
driver = "raw_exec"
user = "root"
config {
command = "bash"
args = ["-c", "zypper remove --no-confirm munge munge-libs munge-devel ; rm -rf /var/run/munge ; "]
}
}
}
}
My problem is with the task “munge” which will only run on Nomad/Consul servers, nomad agents fail to run this task with the following error:
failed to launch command with executor: rpc error: code = Unknown desc = failed to start command path=“/usr/sbin/munged” — args=[“/usr/sbin/munged” “–foreground”]: fork/exec /usr/sbin/munged: permission denied
but surprisingly, I can run the same command when I ssh into the node as:
sudo su munge /usr/sbin/munged --foreground
Any idea of what could be wrong?
thank you