| Server IP : 82.208.35.60 / Your IP : 216.73.216.238 Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31 System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64 User : studiokobylisy_cz ( 1008) PHP Version : 7.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /usr/ports/sysutils/nomad/files/ |
Upload File : |
#!/bin/sh
# 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_debug (bool): Set to NO by default.
# Set it to YES to enable nomad debugging to syslog.
# 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_debug:="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"
extra_commands="reload"
nomad_command="/usr/bin/env ${nomad_env} ${procname} agent -data-dir=${nomad_dir} ${nomad_args}"
command_args="-f -t ${name} -p ${pidfile} ${nomad_command}"
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}"
chmod 0700 "${nomad_dir}"
fi
if [ "${nomad_debug}" != "NO" ]; then
command_args="-T ${name} ${command_args}"
fi
if [ "$(stat -f "%Lp" "${nomad_dir}")" -ne "700" ]; then
2>&1 echo "Error: File permissions of ${nomad_dir} must be 700, not starting."
exit 1
fi
}
run_rc_command "$1"