2021-01-26 19:42:23 +00:00
|
|
|
job "raw_exec" {
|
2021-01-25 21:57:17 +00:00
|
|
|
datacenters = ["dc1"]
|
|
|
|
type = "batch"
|
|
|
|
|
|
|
|
constraint {
|
|
|
|
attribute = "${attr.kernel.name}"
|
|
|
|
value = "linux"
|
|
|
|
}
|
|
|
|
|
2021-01-26 19:42:23 +00:00
|
|
|
group "raw_exec" {
|
|
|
|
task "raw_exec" {
|
|
|
|
driver = "raw_exec"
|
2021-01-25 21:57:17 +00:00
|
|
|
|
|
|
|
config {
|
|
|
|
command = "bash"
|
|
|
|
args = [
|
|
|
|
"-c", "local/pid.sh"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
|
|
|
data = <<EOF
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
echo my pid is $BASHPID
|
|
|
|
EOF
|
|
|
|
|
|
|
|
destination = "local/pid.sh"
|
|
|
|
perms = "777"
|
|
|
|
change_mode = "noop"
|
|
|
|
}
|
|
|
|
|
|
|
|
resources {
|
|
|
|
cpu = 100
|
|
|
|
memory = 64
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|