Skip to content

Commit

Permalink
ci deb: tweak downgrade test case (#733)
Browse files Browse the repository at this point in the history
Now, no need to unmask td-agent because transitional td-agent package
was installed before.

As unmask fluentd is not enough to cleanup td-agent inactive(dead) link
so explicitly disable it to purge them.

Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
  • Loading branch information
kenhys authored Nov 13, 2024
1 parent 11163f6 commit 8dd8bcc
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions fluent-package/apt/systemd-test/downgrade-to-v4.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,17 @@ sudo apt install -V -y \
/host/${distribution}/pool/${code_name}/${channel}/*/*/fluent-package_*_${architecture}.deb \
/host/${distribution}/pool/${code_name}/${channel}/*/*/td-agent_*_all.deb

# td-agent.service is already masked (link to /dev/null), and remove td-agent.service alias not to conflict with v4
sudo systemctl unmask td-agent
sudo systemctl is-active fluentd
sudo systemctl is-active td-agent
sudo systemctl stop fluentd

# Even though removing fluent-package, log and .conf are kept. dpkg reports "rc fluent-package" and "rc td-agent" status.
sudo apt remove -y fluent-package
sudo apt remove -y fluent-package td-agent

# fluentd.service is already masked (link to /dev/null), then remove it.
sudo systemctl unmask fluentd
# purge inacive (dead) symbolic links
sudo systemctl disable td-agent

# Drop symbolic links and recreate real directory.
sudo rm -f /var/log/td-agent
Expand All @@ -45,6 +48,9 @@ sudo chown td-agent:td-agent /etc/td-agent
sudo mv /etc/fluent/td-agent.conf /etc/td-agent/
curl -fsSL https://toolbelt.treasuredata.com/sh/install-${distribution}-${code_name}-td-agent4.sh | sh

# re-create symlink to point service file again
sudo systemctl enable td-agent --now

# Test: service status
(! systemctl status --no-pager fluentd)
(systemctl status --no-pager td-agent)
Expand Down

0 comments on commit 8dd8bcc

Please sign in to comment.