1
0
Fork 0
mirror of https://github.com/eosswedenorg/antelope-api-healthcheck synced 2026-06-16 04:44:55 +02:00

freebsd: tell newsyslog where the pid file is.

This commit is contained in:
Henrik Hautakoski 2020-06-26 03:44:13 +02:00
parent 9e8ee93983
commit 184302b9e4
3 changed files with 7 additions and 2 deletions

View file

@ -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

View file

@ -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 }}

View file

@ -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}"