Last active
August 29, 2015 14:07
-
-
Save tkuchiki/db521cc0795c4a24647a to your computer and use it in GitHub Desktop.
fluentd で fluent-plugin-multiprocess を使っているとき用の configtest
This file contains hidden or 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
#!/bin/bash | |
TD_CONF=/etc/td-agent/td-agent.conf | |
# /usr/sbin/td-agent --user td-agent --group td-agent --dry-run -q --use-v1-config -c $TD_CONF | |
/usr/sbin/td-agent --user td-agent --group td-agent --dry-run -q -c $TD_CONF | |
STATUS=$? | |
IFS=$'\n' | |
for LINE in $(grep cmdline $TD_CONF); do | |
CONFIG_FILE=$(echo $LINE | sed -e 's/ */ /' | egrep -o "(-c|--config) (.+?)" | awk '{print $2}') | |
# /usr/sbin/td-agent --user td-agent --group td-agent --dry-run -q --use-v1-config -c $CONFIG_FILE | |
/usr/sbin/td-agent --user td-agent --group td-agent --dry-run -q -c $CONFIG_FILE | |
if [ $STATUS -eq 0 -a $? -ne 0 ]; then | |
STATUS=1 | |
fi | |
done | |
exit $STATUS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment