aboutsummaryrefslogtreecommitdiff
path: root/sysutils/nomad/files
diff options
context:
space:
mode:
authorKris Moore <kmoore@FreeBSD.org>2016-06-22 20:12:08 +0000
committerKris Moore <kmoore@FreeBSD.org>2016-06-22 20:12:08 +0000
commit163565a45a7b4307068f79547b55f24e09a9e1fb (patch)
treeda542ce372df771a59b6e4dcf376dc67848a036b /sysutils/nomad/files
parent830f0a4e80a6709c808763bd3712fd3b3a252e56 (diff)
downloadports-163565a45a7b4307068f79547b55f24e09a9e1fb.tar.gz
ports-163565a45a7b4307068f79547b55f24e09a9e1fb.zip
Notes
Diffstat (limited to 'sysutils/nomad/files')
-rw-r--r--sysutils/nomad/files/nomad.in55
1 files changed, 55 insertions, 0 deletions
diff --git a/sysutils/nomad/files/nomad.in b/sysutils/nomad/files/nomad.in
new file mode 100644
index 000000000000..652226b08d9c
--- /dev/null
+++ b/sysutils/nomad/files/nomad.in
@@ -0,0 +1,55 @@
+#!/bin/sh
+
+# $FreeBSD: head/sysutils/nomad/files/nomad.in 386655 2015-05-18 02:05:03Z swills $
+#
+# PROVIDE: nomad
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# nomad_enable (bool): Set to NO by default.
+# Set it to YES to enable nomad.
+# nomad_user (user): Set user to run nomad.
+# Default is "nomad".
+# nomad_group (group): Set group to run nomad.
+# Default is "nomad".
+# nomad_dir (dir): Set dir to run nomad in.
+# Default is "/var/tmp/nomad".
+# nomad_env (dir): Set environment variables used with nomad
+# Default is "".
+
+. /etc/rc.subr
+
+name=nomad
+rcvar=nomad_enable
+
+load_rc_config $name
+
+: ${nomad_enable:="NO"}
+: ${nomad_user:="nomad"}
+: ${nomad_group:="nomad"}
+: ${nomad_dir:="/var/tmp/nomad"}
+: ${nomad_env:=""}
+
+pidfile=/var/run/nomad.pid
+procname="%%PREFIX%%/bin/nomad"
+command="/usr/sbin/daemon"
+command_args="-f -p ${pidfile} /usr/bin/env ${nomad_env} ${procname} agent -data-dir=${nomad_dir} -config=%%PREFIX%%/etc/nomad ${nomad_args}"
+
+start_precmd=nomad_startprecmd
+
+nomad_startprecmd()
+{
+ if [ ! -e ${pidfile} ]; then
+ install -o ${nomad_user} -g ${nomad_group} /dev/null ${pidfile};
+ fi
+
+ if [ ! -d ${nomad_dir} ]; then
+ install -d -o ${nomad_user} -g ${nomad_group} ${nomad_dir}
+ fi
+
+}
+
+run_rc_command "$1"