diff --git a/scripts/build_freebsd.sh b/scripts/build_freebsd.sh index d2f142c..0a539f8 100755 --- a/scripts/build_freebsd.sh +++ b/scripts/build_freebsd.sh @@ -5,6 +5,9 @@ PACKAGE_TMPDIR="${PACKAGE_TMPDIR}/freebsd" PACKAGE_RCDIR=/etc/rc.d PACKAGE_NEWSYSLOGDIR=etc/newsyslog.conf.d +# Common variables +PID_FILE=/var/run/${PACKAGE_NAME}.pid + ############################ # Create rc file # ############################ @@ -15,6 +18,7 @@ RC_NAME=$(echo ${PACKAGE_NAME} | sed "s~-~_~g") mkdir -p ${BASE_DIR}/${PACKAGE_TMPDIR}/${PACKAGE_RCDIR} cat ${TEMPLATE_DIR}/rc.conf \ | sed "s~{{ RC_NAME }}~${RC_NAME}~g" \ + | sed "s~{{ PID_FILE }}~${PID_FILE}~g" \ | sed "s~{{ DESCRIPTION }}~${PACKAGE_DESCRIPTION}~" \ | sed "s~{{ PROGRAM }}~/${PACKAGE_BINDIR}/${PACKAGE_NAME}~" \ > ${BASE_DIR}/${PACKAGE_TMPDIR}/${PACKAGE_RCDIR}/${RC_NAME} @@ -29,6 +33,7 @@ chmod 755 ${BASE_DIR}/${PACKAGE_TMPDIR}/${PACKAGE_RCDIR}/${RC_NAME} mkdir -p ${BASE_DIR}/${PACKAGE_TMPDIR}/${PACKAGE_NEWSYSLOGDIR} cat ${TEMPLATE_DIR}/newsyslog.conf \ | sed "s~{{ LOG_FILE }}~${PACKAGE_LOGFILE}~" \ + | sed "s~{{ PID_FILE }}~${PID_FILE}~g" \ > ${BASE_DIR}/${PACKAGE_TMPDIR}/${PACKAGE_NEWSYSLOGDIR}/${PACKAGE_NAME}.conf diff --git a/scripts/templates/newsyslog.conf b/scripts/templates/newsyslog.conf index ebc08e8..99b93c0 100644 --- a/scripts/templates/newsyslog.conf +++ b/scripts/templates/newsyslog.conf @@ -1,2 +1,2 @@ # logfilename [owner:group] mode count size when flags [/pid_file] [sig_num] -{{ LOG_FILE }} 640 3 * @T10 JC +{{ LOG_FILE }} 640 3 * @T10 JC {{ PID_FILE }} diff --git a/scripts/templates/rc.conf b/scripts/templates/rc.conf index 8464749..a9fb36a 100644 --- a/scripts/templates/rc.conf +++ b/scripts/templates/rc.conf @@ -16,7 +16,7 @@ name="{{ RC_NAME }}" desc="{{ DESCRIPTION }}" logfile="${eosio_api_healthcheck_logfile:-/var/log/${name}.log}" -pidfile="/var/run/${name}.pid" +pidfile="{{ PID_FILE }}" command="{{ PROGRAM }}" command_args="-p ${pidfile} ${eosio_api_healthcheck_args}"