Last active
December 22, 2015 13:58
-
-
Save myster-t/6482469 to your computer and use it in GitHub Desktop.
/etc/default/beanstalkd to set BEANSTALKD_OPTIONS for Upstart script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set some constants to be used to construct BEANSTALKD_OPTIONS | |
BEANSTALKD_ADDR=0.0.0.0 | |
BEANSTALKD_PORT=11300 | |
BEANSTALKD_USER=beanstalkd | |
BEANSTALKD_BINLOG_DIR=/var/lib/beanstalkd | |
BEANSTALKD_BINLOG_FSYNC_PERIOD=0 | |
# Create the actual BEANSTALKD_OPTIONS string | |
# Copied from https://gist.github.com/shiki/515422 | |
BEANSTALKD_OPTIONS="-l ${BEANSTALKD_ADDR} -p ${BEANSTALKD_PORT} -u ${BEANSTALKD_USER}" | |
if [ "${BEANSTALKD_MAX_JOB_SIZE}" != "" ]; then | |
BEANSTALKD_OPTIONS="${BEANSTALKD_OPTIONS} -z ${BEANSTALKD_MAX_JOB_SIZE}" | |
fi | |
if [ "${BEANSTALKD_BINLOG_DIR}" != "" ]; then | |
if [ ! -d "${BEANSTALKD_BINLOG_DIR}" ]; then | |
echo "Creating binlog directory (${BEANSTALKD_BINLOG_DIR})" | |
mkdir -p ${BEANSTALKD_BINLOG_DIR} && chown ${BEANSTALKD_USER}:${BEANSTALKD_USER} ${BEANSTALKD_BINLOG_DIR} | |
fi | |
BEANSTALKD_OPTIONS="${BEANSTALKD_OPTIONS} -b ${BEANSTALKD_BINLOG_DIR}" | |
if [ "${BEANSTALKD_BINLOG_FSYNC_PERIOD}" != "" ]; then | |
BEANSTALKD_OPTIONS="${BEANSTALKD_OPTIONS} -f ${BEANSTALKD_BINLOG_FSYNC_PERIOD}" | |
else | |
BEANSTALKD_OPTIONS="${BEANSTALKD_OPTIONS} -F" | |
fi | |
if [ "${BEANSTALKD_BINLOG_SIZE}" != "" ]; then | |
BEANSTALKD_OPTIONS="${BEANSTALKD_OPTIONS} -s ${BEANSTALKD_BINLOG_SIZE}" | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment