Index: head/sysutils/nomad/Makefile =================================================================== --- head/sysutils/nomad/Makefile (revision 507309) +++ head/sysutils/nomad/Makefile (revision 507310) @@ -1,45 +1,46 @@ # $FreeBSD$ PORTNAME= nomad DISTVERSIONPREFIX= v DISTVERSION= 0.9.3 +PORTREVISION= 1 CATEGORIES= sysutils MAINTAINER= jhixson@FreeBSD.org COMMENT= Cluster manager and scheduler LICENSE= MPL20 LICENSE_FILE= ${WRKSRC}/LICENSE ONLY_FOR_ARCHS= amd64 ONLY_FOR_ARCHS_REASON= On i386: go compiler crashes: https://github.com/golang/go/issues/23763 USES= compiler go USE_GITHUB= yes GH_ACCOUNT= hashicorp GH_SUBDIR= src/github.com/hashicorp/nomad USE_RC_SUBR= nomad USERS= nomad GROUPS= nomad do-build: @cd ${WRKSRC}/src/github.com/hashicorp/nomad && \ ${SETENV} ${MAKE_ENV} ${BUILD_ENV} GOPATH=${WRKSRC} go build -v -x \ -ldflags "-X main.GitDescribe=${DISTVERSIONFULL}" -o bin/nomad do-install: ${INSTALL_PROGRAM} ${WRKSRC}/src/github.com/hashicorp/nomad/bin/nomad ${STAGEDIR}${PREFIX}/bin/nomad @${MKDIR} ${STAGEDIR}${PREFIX}/etc/nomad ${INSTALL_DATA} ${WRKSRC}/src/github.com/hashicorp/nomad/dist/client.hcl \ ${STAGEDIR}${PREFIX}/etc/nomad/client.hcl.sample ${INSTALL_DATA} ${WRKSRC}/src/github.com/hashicorp/nomad/dist/server.hcl \ ${STAGEDIR}${PREFIX}/etc/nomad/server.hcl.sample .include .if ${COMPILER_TYPE} == clang BUILD_ENV= CC=clang .endif .include Index: head/sysutils/nomad/files/nomad.in =================================================================== --- head/sysutils/nomad/files/nomad.in (revision 507309) +++ head/sysutils/nomad/files/nomad.in (revision 507310) @@ -1,55 +1,61 @@ #!/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_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" -command_args="-f -p ${pidfile} /usr/bin/env ${nomad_env} ${procname} agent -data-dir=${nomad_dir} ${nomad_args}" +nomad_command="/usr/bin/env ${nomad_env} ${procname} agent -data-dir=${nomad_dir} ${nomad_args}" +command_args="-f -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 [ ! -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 - + if [ ! -d ${nomad_dir} ]; then + install -d -o ${nomad_user} -g ${nomad_group} ${nomad_dir} + fi + if [ "${nomad_debug}" != "NO" ]; then + command_args="-S -T ${name} -p ${pidfile} ${nomad_command}" + fi } run_rc_command "$1"