2023-04-10 15:36:59 +00:00
|
|
|
# Copyright (c) HashiCorp, Inc.
|
|
|
|
# SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2019-01-26 00:51:20 +00:00
|
|
|
# Restarter fakes being a flaky service that crashes and restarts constantly.
|
|
|
|
# Restarting the Nomad agent during task restarts was a known cause of state
|
|
|
|
# corruption in v0.8.
|
|
|
|
|
|
|
|
job "restarter" {
|
|
|
|
datacenters = ["dc1"]
|
2019-10-11 12:00:05 +00:00
|
|
|
|
2019-11-25 18:31:00 +00:00
|
|
|
constraint {
|
|
|
|
attribute = "${attr.kernel.name}"
|
|
|
|
value = "linux"
|
|
|
|
}
|
|
|
|
|
2019-01-26 00:51:20 +00:00
|
|
|
group "restarter" {
|
|
|
|
restart {
|
|
|
|
attempts = 100
|
|
|
|
delay = "3s"
|
|
|
|
}
|
2019-10-11 12:00:05 +00:00
|
|
|
|
2019-01-26 00:51:20 +00:00
|
|
|
task "restarter" {
|
|
|
|
driver = "raw_exec"
|
2019-10-11 12:00:05 +00:00
|
|
|
|
2019-01-26 00:51:20 +00:00
|
|
|
config {
|
|
|
|
command = "/bin/bash"
|
|
|
|
args = ["-c", "echo $$ >> pid && sleep 1 && exit 99"]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|