From 9e0ec0927cef1f6a29b79696930e708be68d02df Mon Sep 17 00:00:00 2001 From: Ellison Marks Date: Tue, 27 Oct 2015 11:11:55 -0700 Subject: [PATCH] Making sure telegraf.d directory is created by packages. --- scripts/package.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/package.sh b/scripts/package.sh index e88e52f9e..43142cf7e 100755 --- a/scripts/package.sh +++ b/scripts/package.sh @@ -34,6 +34,7 @@ AWS_FILE=~/aws.conf INSTALL_ROOT_DIR=/opt/telegraf TELEGRAF_LOG_DIR=/var/log/telegraf CONFIG_ROOT_DIR=/etc/opt/telegraf +CONFIG_D_DIR=/etc/opt/telegraf/telegraf.d LOGROTATE_DIR=/etc/logrotate.d SAMPLE_CONFIGURATION=etc/config.sample.toml @@ -79,9 +80,14 @@ make_dir_tree() { echo "Failed to create configuration directory -- aborting." cleanup_exit 1 fi + mkdir -p $work_dir/$CONFIG_D_DIR + if [ $? -ne 0 ]; then + echo "Failed to create configuration subdirectory -- aborting." + cleanup_exit 1 + fi mkdir -p $work_dir/$LOGROTATE_DIR if [ $? -ne 0 ]; then - echo "Failed to create configuration directory -- aborting." + echo "Failed to create logrotate directory -- aborting." cleanup_exit 1 fi