Skip to content

Commit

Permalink
ci: show .service for debug
Browse files Browse the repository at this point in the history
Signed-off-by: Kentaro Hayashi <[email protected]>
  • Loading branch information
kenhys committed Nov 12, 2024
1 parent 649cfc1 commit fe7c49e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions fluent-package/apt/systemd-test/downgrade-to-v4.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
#!/bin/bash

function debug_service_files() {
echo $1
set +e
ls -la /usr/lib/systemd/system/ |grep -E 'td-agent|fluent-package'
ls -la /etc/systemd/system
ls -la /usr/lib/systemd/system/multi-user.target.wants/
set -e
}

set -exu

. $(dirname $0)/../commonvar.sh
Expand All @@ -26,9 +35,13 @@ sudo systemctl unmask td-agent
# 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 td-agent

debug_service_files "DEBUG: after remove fluent-package td-agent"

# fluentd.service is already masked (link to /dev/null), then remove it.
sudo systemctl unmask fluentd

debug_service_files "DEBUG: after unmask fluentd"

# Drop symbolic links and recreate real directory.
sudo rm -f /var/log/td-agent
sudo rm -f /etc/td-agent
Expand All @@ -45,6 +58,8 @@ 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

debug_service_files "DEBUG: after downgrade"

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

0 comments on commit fe7c49e

Please sign in to comment.