Skip to content

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

Merged
Watson1978 merged 12 commits intofluent:masterfrom
Watson1978:working-directory
Feb 24, 2026
Merged

rpm: fix update error if working directory is missing#955
Watson1978 merged 12 commits intofluent:masterfrom
Watson1978:working-directory

Conversation

@Watson1978
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@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
Copy Markdown
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

Watson1978 and others added 11 commits February 24, 2026 10:36
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>
Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
> Job 'test' depends on job 'confluent_test' which creates a cycle in
the dependency graph.,

Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
@kenhys
Copy link
Copy Markdown
Contributor

kenhys commented Feb 24, 2026

Added nitpick fix which was introduced by #972 accidentally.

Comment thread fluent-package/apt/systemd-test/downgrade-to-v6-lts-tmpfiles.sh Outdated
Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
@Watson1978 Watson1978 requested a review from kenhys February 24, 2026 04:52
Copy link
Copy Markdown
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.

LGTM.

@Watson1978
Copy link
Copy Markdown
Contributor Author

Thanks

@Watson1978 Watson1978 merged commit b5c1ce3 into fluent:master Feb 24, 2026
431 of 435 checks passed
@Watson1978 Watson1978 deleted the working-directory branch February 24, 2026 05:15
Watson1978 added a commit that referenced this pull request Feb 24, 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
```

---------

Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
Co-authored-by: Kentaro Hayashi <hayashi@clear-code.com>
Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
@Watson1978 Watson1978 added the backported Already backported to LTS branch (e.g. fluent-package-v5) label Feb 24, 2026
kenhys added a commit that referenced this pull request Feb 24, 2026
…955) (#977)

Backport #955

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
```

---------

Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
Co-authored-by: Kentaro Hayashi <hayashi@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 backported Already backported to LTS branch (e.g. fluent-package-v5)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants