-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
There was a case that missing quote about file name causes migration failures. * No quote under /etc/td-agent/'PATH_WITH_SPACE' * No quote under /var/log/td-agent/'PATH_WITH_SPACE' Usually such files should not be generated, but need to care it in practical use case.
- Loading branch information
Showing
6 changed files
with
90 additions
and
25 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -197,12 +197,15 @@ if [ $1 -eq 1 ]; then | |
if [ -f /etc/@COMPAT_PACKAGE_DIR@/@[email protected] -a ! -e /etc/@COMPAT_PACKAGE_DIR@/@[email protected] ]; then | ||
create_link_for_config=y | ||
fi | ||
for d in /etc/@COMPAT_PACKAGE_DIR@/*; do | ||
if [ ! "$d" == "/etc/@COMPAT_PACKAGE_DIR@/plugin" ]; then | ||
echo "Migrating from $d to /etc/@PACKAGE_DIR@/..." | ||
mv -f $d /etc/@PACKAGE_DIR@/ | ||
fi | ||
done | ||
if [ -n "$(ls /etc/@COMPAT_PACKAGE_DIR@/)" ]; then | ||
for d in /etc/@COMPAT_PACKAGE_DIR@/*; do | ||
if [ ! "$d" = "/etc/@COMPAT_PACKAGE_DIR@/plugin" ]; then | ||
# except managed under deb files must be migrated | ||
echo "Migrating from /etc/@COMPAT_PACKAGE_DIR@/$d to /etc/<%= package_dir %>/..." | ||
mv -f "$d" /etc/@PACKAGE_DIR@/ | ||
fi | ||
done | ||
fi | ||
if [ $create_link_for_config = "y" ]; then | ||
rm -f /etc/@PACKAGE_DIR@/@[email protected] | ||
ln -sf /etc/@PACKAGE_DIR@/@[email protected] /etc/@PACKAGE_DIR@/@[email protected] | ||
|
@@ -236,12 +239,15 @@ if [ $1 -eq 1 ]; then | |
if [ -d /var/log/@COMPAT_PACKAGE_DIR@/buffer -a -n "$(ls /var/log/@COMPAT_PACKAGE_DIR@/buffer)" ]; then | ||
mv -f /var/log/@COMPAT_PACKAGE_DIR@/buffer/* /var/log/@PACKAGE_DIR@/buffer/ | ||
fi | ||
for d in /var/log/@COMPAT_PACKAGE_DIR@/*; do | ||
if [ ! "$d" == "/var/log/@COMPAT_PACKAGE_DIR@/buffer" ]; then | ||
# /var/log/@COMPAT_PACKAGE_DIR@/buffer will be removed from td-agent | ||
mv -f $d /var/log/@PACKAGE_DIR@/ | ||
fi | ||
done | ||
# migrate log files except owned buffer | ||
if [ -n "$(ls /var/log/@COMPAT_PACKAGE_DIR@/)" ]; then | ||
for d in /var/log/@COMPAT_PACKAGE_DIR@/*; do | ||
if [ ! "$d" == "/var/log/@COMPAT_PACKAGE_DIR@/buffer" ]; then | ||
# /var/log/@COMPAT_PACKAGE_DIR@/buffer will be removed from td-agent | ||
mv -f "$d" /var/log/@PACKAGE_DIR@/ | ||
fi | ||
done | ||
fi | ||
if [ -f /var/log/@PACKAGE_DIR@/@[email protected] ]; then | ||
# Backup the config since RPM removes the file if it is not edited. | ||
if [ -f /etc/logrotate.d/@COMPAT_SERVICE_NAME@ ]; then | ||
|
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
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