Skip to content

Commit

Permalink
Migrate path of pid
Browse files Browse the repository at this point in the history
Signed-off-by: Kentaro Hayashi <[email protected]>
  • Loading branch information
kenhys committed Jul 4, 2023
1 parent 43e9343 commit cc380ae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ migration_from_v4_main_process() {
echo "Keep logging to <%= compat_service_name %>.log ..."
sed -i"" /etc/default/<%= service_name %> -e "/TD_AGENT_LOG_FILE/c TD_AGENT_LOG_FILE=/var/log/<%= package_dir %>/<%= compat_service_name %>.log"
fi
if [ -f /etc/logrotate.d/<%= compat_service_name %> ]; then
echo "Migrating path of pid ..."
sed -i"" /etc/logrotate.d/<%= compat_service_name %> -e "s,/var/run/<%= compat_package_dir %>/<%= compat_service_name %>.pid,/var/run/<%= package_dir %>/<%= service_name %>.pid,"
fi
fi
}

Expand Down
4 changes: 4 additions & 0 deletions fluent-package/yum/fluent-package.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,10 @@ if [ -f %{v4migration} ]; then
echo "Provides /var/log/td-agent symlink for backward compatibility"
ln -sf /var/log/@PACKAGE_DIR@ /var/log/@COMPAT_PACKAGE_DIR@
fi
if [ -f /etc/logrotate.d/@COMPAT_SERVICE_NAME@ ]; then
echo "Migrating path of pid ..."
sed -i"" /etc/logrotate.d/@COMPAT_SERVICE_NAME@ -e "s,/var/run/@COMPAT_PACKAGE_DIR@/@[email protected],/var/run/@PACKAGE_DIR@/@[email protected],"
fi
rm -f %{v4migration}
if [ -f %{v4migration_with_restart} ]; then
# When upgrading from v4, td-agent.service will be removed
Expand Down

0 comments on commit cc380ae

Please sign in to comment.