Skip to content

Commit

Permalink
deb: don't always fire v4 restart process
Browse files Browse the repository at this point in the history
Before:

* if td-agent.service exist and td-agent is active,
  stop td-agent and force v4 migration with restart process
  in postinst configure phase.

After:

* only execute v4 migration with restart process
  still v4 migration phase in postinst configure phase.

It might be a bug for v5.x

Signed-off-by: Kentaro Hayashi <[email protected]>
  • Loading branch information
kenhys committed Oct 31, 2024
1 parent f31b7cf commit 2d66952
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,17 @@ migration_from_v4_main_process() {
rm -f /etc/<%= package_dir %>/<%= service_name %>.conf
ln -sf /etc/<%= package_dir %>/<%= compat_service_name %>.conf /etc/<%= package_dir %>/<%= service_name %>.conf
fi
fi
if [ -h /etc/systemd/system/td-agent.service ]; then
if [ -n "$(command -v systemctl)" ]; then
if systemctl is-active <%= compat_service_name %> >/dev/null; then
# Want to restart with new user/group here,
# but to avoid holding file descriptor under /var/log/<%= compat_package_dir %>/,
# delay restarting <%= service_name %> service.
systemctl stop <%= compat_service_name %>
v4migration_with_restart=y
fi
fi
if [ -h /etc/systemd/system/td-agent.service ]; then
if [ -n "$(command -v systemctl)" ]; then
if systemctl is-active <%= compat_service_name %> >/dev/null; then
# Want to restart with new user/group here,
# but to avoid holding file descriptor under /var/log/<%= compat_package_dir %>/,
# delay restarting <%= service_name %> service.
systemctl stop <%= compat_service_name %>
v4migration_with_restart=y
fi
fi
fi
fi
if [ -d /var/log/<%= compat_package_dir %> -a ! -h /var/log/<%= compat_package_dir %> ]; then
# /var/log/<%= compat_package_dir %> migration from v4
Expand Down

0 comments on commit 2d66952

Please sign in to comment.