aboutsummaryrefslogtreecommitdiffstats
path: root/testing/nomad/nomad.initd
diff options
context:
space:
mode:
Diffstat (limited to 'testing/nomad/nomad.initd')
-rw-r--r--testing/nomad/nomad.initd38
1 files changed, 38 insertions, 0 deletions
diff --git a/testing/nomad/nomad.initd b/testing/nomad/nomad.initd
new file mode 100644
index 0000000000..05949fd87a
--- /dev/null
+++ b/testing/nomad/nomad.initd
@@ -0,0 +1,38 @@
+#!/sbin/openrc-run
+name="Nomad"
+description="An easy-to-use, flexible, and performant workload orchestrator"
+description_healthcheck="Check health status"
+description_reload="Reload configuration"
+
+extra_started_commands="healthcheck reload"
+
+command="/usr/sbin/${RC_SVCNAME}"
+command_args="${nomad_opts}"
+command_user="root:root"
+
+supervisor=supervise-daemon
+output_log="/var/log/${RC_SVCNAME}.log"
+error_log="/var/log/${RC_SVCNAME}.log"
+respawn_max=0
+respawn_delay=10
+healthcheck_timer=60
+
+depend() {
+ need net
+ after firewall
+}
+
+start_pre() {
+ checkpath -f -m 0644 -o "$command_user" "$output_log" "$error_log"
+}
+
+healthcheck() {
+ $command agent-info > /dev/null 2>&1
+}
+
+reload() {
+ start_pre \
+ && ebegin "Reloading $RC_SVCNAME configuration" \
+ && $supervisor "$RC_SVCNAME" --signal HUP
+ eend $?
+}