Merge pull request #4033 from influxdb/logrotate

Install logrotate configuration
pull/4038/head
Philip O'Toole 2015-09-08 12:02:54 -07:00
commit 8297fc8c43
3 changed files with 30 additions and 8 deletions

View File

@ -15,6 +15,7 @@ With this release InfluxDB is moving to Go 1.5.
- [#3986](https://github.com/influxdb/influxdb/pull/3986): Support sorting by time desc
- [#3930](https://github.com/influxdb/influxdb/pull/3930): Wire up TOP aggregate function - fixes [#1821](https://github.com/influxdb/influxdb/issues/1821)
- [#3996](https://github.com/influxdb/influxdb/pull/3996): Add statistics to httpd package
- [#4003](https://github.com/influxdb/influxdb/pull/4033): Add logrotate configuration.
### Bugfixes
- [#3785](https://github.com/influxdb/influxdb/issues/3785): Invalid time stamp in graphite metric causes panic

View File

@ -40,9 +40,11 @@ INSTALL_ROOT_DIR=/opt/influxdb
INFLUXDB_LOG_DIR=/var/log/influxdb
INFLUXDB_DATA_DIR=/var/opt/influxdb
CONFIG_ROOT_DIR=/etc/opt/influxdb
LOGROTATE_DIR=/etc/logrotate.d
SAMPLE_CONFIGURATION=etc/config.sample.toml
INITD_SCRIPT=scripts/init.sh
LOGROTATE=scripts/logrotate
TMP_WORK_DIR=`mktemp -d`
POST_INSTALL_PATH=`mktemp`
@ -179,6 +181,11 @@ make_dir_tree() {
echo "Failed to create configuration directory -- aborting."
cleanup_exit 1
fi
mkdir -p $work_dir/$LOGROTATE_DIR
if [ $? -ne 0 ]; then
echo "Failed to create logrotate directory -- aborting."
cleanup_exit 1
fi
}
# do_build builds the code. The version and commit must be passed in.
@ -375,6 +382,12 @@ if [ $? -ne 0 ]; then
cleanup_exit 1
fi
cp $LOGROTATE $TMP_WORK_DIR/$LOGROTATE_DIR/influxdb.conf
if [ $? -ne 0 ]; then
echo "Failed to copy logrotate configuration to packaging directory -- aborting."
cleanup_exit 1
fi
generate_postinstall_script $VERSION
###########################################################################
@ -403,7 +416,7 @@ else
debian_package=influxdb_${VERSION}_amd64.deb
fi
COMMON_FPM_ARGS="--log error -C $TMP_WORK_DIR --vendor $VENDOR --url $URL --license $LICENSE --maintainer $MAINTAINER --after-install $POST_INSTALL_PATH --name influxdb --version $VERSION --config-files $CONFIG_ROOT_DIR ."
COMMON_FPM_ARGS="--log error -C $TMP_WORK_DIR --vendor $VENDOR --url $URL --license $LICENSE --maintainer $MAINTAINER --after-install $POST_INSTALL_PATH --name influxdb --version $VERSION --config-files $CONFIG_ROOT_DIR --config-files $LOGROTATE_DIR."
if [ -n "$DEB_WANTED" ]; then
$FPM -s dir -t deb $deb_args --description "$DESCRIPTION" $COMMON_FPM_ARGS

8
scripts/logrotate Normal file
View File

@ -0,0 +1,8 @@
/var/log/influxdb/influxd.log {
daily
rotate 7
missingok
dateext
copytruncate
compress
}