Skip to content

Commit

Permalink
deb: ensure to reload unit file before restarting (#512)
Browse files Browse the repository at this point in the history
It fixes the following case:

      Failed to restart fluentd.service: Unit fluentd.service not found.
      dpkg: error processing package fluent-package (--configure):
installed fluent-package package post-installation script subprocess
returned error exit status 5

---------

Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
Co-authored-by: Daijiro Fukuda <fukuda@clear-code.com>
  • Loading branch information
kenhys and daipom authored Jul 15, 2023
1 parent b60c833 commit 8bde5ab
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions fluent-package/apt/systemd-test/install-newly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ systemctl status --no-pager fluentd

sudo apt remove -y fluent-package

test -h /etc/systemd/system/fluentd.service
! systemctl status fluentd
5 changes: 3 additions & 2 deletions fluent-package/apt/systemd-test/update-from-v4.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ sudo apt install -V -y \
systemctl status --wait --no-pager fluentd
! systemctl status --wait --no-pager td-agent

# TODO: There are some tests being commented out. They will be supported by future fixes.

# Test: restoring td-agent service alias
sudo systemctl unmask td-agent
sudo systemctl enable --now fluentd
Expand Down Expand Up @@ -57,3 +55,6 @@ test $(eval $env_vars && echo $FLUENT_PACKAGE_LOG_FILE) = "/var/log/fluent/td-ag
sudo apt remove -y fluent-package
! systemctl status --wait --no-pager td-agent
! systemctl status --wait --no-pager fluentd

test -h /etc/systemd/system/td-agent.service
test -h /etc/systemd/system/fluentd.service
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ migration_from_v4_post_process() {
fi
if [ "$v4migration_with_restart" = "y" ]; then
if [ -n "$(command -v systemctl)" ]; then
systemctl daemon-reload
systemctl restart <%= service_name %>
fi
fi
Expand Down

0 comments on commit 8bde5ab

Please sign in to comment.