Skip to content

Comments

rpm: fix update error if working directory is missing#955

Open
Watson1978 wants to merge 10 commits intofluent:masterfrom
Watson1978:working-directory
Open

rpm: fix update error if working directory is missing#955
Watson1978 wants to merge 10 commits intofluent:masterfrom
Watson1978:working-directory

Conversation

@Watson1978
Copy link
Contributor

@Watson1978 Watson1978 commented Feb 10, 2026

If /tmp/fluent/ was removed, it causes error when update to Fluent Package 6.0.x as following:

# dnf install ./fluent-package-5.0.9-1.el8.x86_64.rpm

# rm -rf /tmp/fluent/

# dnf install -y ./fluent-package-6.0.1-1.el8.x86_64.rpm
Last metadata expiration check: 0:55:01 ago on Tue Feb 10 05:05:41 2026.
Dependencies resolved.
====================================================================================================================================================================
 Package                                   Architecture                      Version                                  Repository                               Size
====================================================================================================================================================================
Upgrading:
 fluent-package                            x86_64                            6.0.1-1.el8                              @commandline                             23 M

Transaction Summary
====================================================================================================================================================================
Upgrade  1 Package

Total size: 23 M
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                            1/1
  Running scriptlet: fluent-package-6.0.1-1.el8.x86_64                                                                                                          1/1
  Running scriptlet: fluent-package-6.0.1-1.el8.x86_64                                                                                                          1/2
/var/tmp/rpm-tmp.Fp7H9o: line 39: /tmp/fluent/.local_base_plugins: No such file or directory
error: %prein(fluent-package-6.0.1-1.el8.x86_64) scriptlet failed, exit status 1

Error in PREIN scriptlet in rpm package fluent-package
  Verifying        : fluent-package-6.0.1-1.el8.x86_64                                                                                                          1/2
  Verifying        : fluent-package-5.0.9-1.el8.x86_64                                                                                                          2/2

Failed:
  fluent-package-5.0.9-1.el8.x86_64                                                fluent-package-6.0.1-1.el8.x86_64

Error: Transaction failed

@Watson1978 Watson1978 changed the title Fix update error when working directory is missing rpm: fix update error when working directory is missing Feb 10, 2026
@Watson1978 Watson1978 changed the title rpm: fix update error when working directory is missing rpm: fix update error if working directory is missing Feb 10, 2026
@Watson1978 Watson1978 force-pushed the working-directory branch 6 times, most recently from ca11a50 to db58633 Compare February 10, 2026 08:41
@Watson1978 Watson1978 marked this pull request as ready for review February 12, 2026 00:52
@Watson1978 Watson1978 requested a review from kenhys February 12, 2026 00:55
Copy link
Contributor

@kenhys kenhys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I come to think using /tmp/fluent is bad design failure.

So, it might be better to switch using /var/cache/fluent or something instead.
What do you think?
(If already /var/cache/fluent is used by user, need to care that too)

@Watson1978
Copy link
Contributor Author

That makes sense.
it might be appropriate into /var/cache/fluent.

In additional, maybe we should replace /tmp/fluent/.main_pid into /var/run/fluent.main_pid or other.

@Watson1978
Copy link
Contributor Author

In additional, maybe we should replace /tmp/fluent/.main_pid into /var/run/fluent.main_pid or other.

I did miss read.
main pid files already located in /var/run/fluent/fluentd.pid

# systemctl cat fluentd
# /usr/lib/systemd/system/fluentd.service
...

PIDFile=/var/run/fluent/fluentd.pid

...

@Watson1978 Watson1978 added this to the v6.1.0 milestone Feb 12, 2026
@Watson1978 Watson1978 added the backport to v6.0 Need to be backported LTS label Feb 12, 2026
@Watson1978 Watson1978 marked this pull request as draft February 13, 2026 01:11
@Watson1978 Watson1978 force-pushed the working-directory branch 12 times, most recently from 6786caf to b4214a6 Compare February 17, 2026 08:00
Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
- Switch from /tmp/fluent to /var/cache/fluent for upgrade-related files.
- This avoids issues where /tmp is cleaned by systemd-tmpfiles or
  accidentally modified by users.
- Ensures the directory exists during the package upgrade process.

Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
@Watson1978 Watson1978 marked this pull request as ready for review February 19, 2026 03:18
@Watson1978 Watson1978 requested a review from kenhys February 19, 2026 03:18
Copy link
Contributor

@kenhys kenhys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add test case for downgrading to v6.0.0 or v6.0.1?
something like downgrade-to-v6-lts-tmpfiles.sh

Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport to v6.0 Need to be backported LTS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants