Skip to content

Commit 7e511e9

Browse files
authored
FLUENT_PACKAGE_SERVICE_RESTART: make empty or other values as auto (#767)
1 parent 038b770 commit 7e511e9

File tree

5 files changed

+15
-7
lines changed

5 files changed

+15
-7
lines changed

.github/workflows/apt.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,12 @@ jobs:
178178
- "update-to-next-version-service-status.sh disabled active"
179179
- "update-to-next-version-service-status.sh disabled inactive"
180180
- "update-to-next-version-with-auto-and-manual.sh"
181-
- "update-to-next-major-version.sh auto"
182-
- "update-to-next-major-version.sh manual"
183-
- "update-to-next-major-version.sh etc"
181+
- "update-to-next-major-version.sh auto active"
182+
- "update-to-next-major-version.sh auto inactive"
183+
- "update-to-next-major-version.sh manual active"
184+
- "update-to-next-major-version.sh manual inactive"
185+
- "update-to-next-major-version.sh etc active"
186+
- "update-to-next-major-version.sh etc inactive"
184187
- "update-without-data-lost.sh v5 v6"
185188
- "update-without-data-lost.sh v6 v5"
186189
include:

fluent-package/apt/systemd-test/update-to-next-major-version.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,16 @@ set -exu
55
. $(dirname $0)/../commonvar.sh
66

77
service_restart=$1
8+
status_before_update=$2 # active / inactive
89

910
# Install the current
1011
sudo apt install -V -y \
1112
/host/${distribution}/pool/${code_name}/${channel}/*/*/fluent-package_*_${architecture}.deb
1213

14+
if [ "$status_before_update" = inactive ]; then
15+
sudo systemctl stop fluentd
16+
fi
17+
1318
# Set FLUENT_PACKAGE_SERVICE_RESTART
1419
sed -i "s/=auto/=$service_restart/" /etc/default/fluentd
1520

@@ -35,7 +40,7 @@ if dpkg-query --show --showformat='${Version}' needrestart ; then
3540
fi
3641

3742
# Test: Check whether plugin/gem were installed during upgrading
38-
if [ "$service_restart" = auto ]; then
43+
if [ "$service_restart" != manual ] && [ "$status_before_update" = active ]; then
3944
# plugin gem should be installed automatically
4045
/opt/fluent/bin/fluent-gem list | grep fluent-plugin-concat
4146
# Non fluent-plugin- prefix gem should not be installed automatically

fluent-package/templates/package-scripts/fluent-package/deb/prerm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ leave_info_for_auto_restart_if_need() {
4040

4141
. "/etc/default/<%= service_name %>"
4242
echo "FLUENT_PACKAGE_SERVICE_RESTART: $FLUENT_PACKAGE_SERVICE_RESTART"
43-
if [ "$FLUENT_PACKAGE_SERVICE_RESTART" != auto ]; then
43+
if [ "$FLUENT_PACKAGE_SERVICE_RESTART" = manual ]; then
4444
return
4545
fi
4646

fluent-package/yum/fluent-package.spec.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ if [ $1 -eq 1 ]; then
219219
else
220220
. %{_sysconfdir}/sysconfig/@SERVICE_NAME@
221221
echo "FLUENT_PACKAGE_SERVICE_RESTART: $FLUENT_PACKAGE_SERVICE_RESTART"
222-
if [ "$FLUENT_PACKAGE_SERVICE_RESTART" = auto ]; then
222+
if [ "$FLUENT_PACKAGE_SERVICE_RESTART" != manual ]; then
223223
# Present that FROM-side wants auto installing plugins and restarting.
224224
# Note: Wants to collect plugin-list here, but we need to do it in %pre (see comments in %pre).
225225
touch %{install_plugins}

fluent-package/yum/systemd-test/update-to-next-major-version.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ package="/host/v6-test/${distribution}/${DISTRIBUTION_VERSION}/x86_64/Packages/f
2727
sudo $DNF install -y $package
2828

2929
# Test: Check whether plugin/gem were installed during upgrading
30-
if [ "$service_restart" = auto ] && [ "$status_before_update" = active ]; then
30+
if [ "$service_restart" != manual ] && [ "$status_before_update" = active ]; then
3131
# plugin gem should be installed automatically
3232
/opt/fluent/bin/fluent-gem list | grep fluent-plugin-concat
3333
# Non fluent-plugin- prefix gem should not be installed automatically

0 commit comments

Comments
 (0)