Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packaging: fix preremove script preventing upgrades on RHEL based OS. #6067

Merged
merged 2 commits into from
Oct 13, 2023

Conversation

wilfriedroset
Copy link
Collaborator

What this PR does

fix preremove script preventing upgrades on RHEL based OS.

Which issue(s) this PR fixes or relates to

Fixes #6063

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@wilfriedroset
Copy link
Collaborator Author

@JustNZ what do you think about the fix?

@JustNZ
Copy link

JustNZ commented Sep 20, 2023

Hey @wilfriedroset

Looking good - thanks for that

@wilfriedroset
Copy link
Collaborator Author

Sorry about the delay, I've completed the test.
I've rebuild 2.9. with the correction and 2.10, then I've manually installed the freshly build 2.9 with success, upgrade to 2.10 with success. I've uninstalled everything to confirm that it work as expected then I've install 2.10 to make sure I did not miss a thing.

Here is the result

[root@test mimir]# yum install ../dist-2.9/mimir-2.9.0_amd64.rpm
Last metadata expiration check: 0:17:32 ago on Tue 26 Sep 2023 03:31:52 PM UTC.
Dependencies resolved.
===============================================================================================
 Package            Architecture        Version                Repository                 Size
===============================================================================================
Installing:
 mimir              x86_64              2.9.0-1                @commandline               20 M

Transaction Summary
===============================================================================================
Install  1 Package

Total size: 20 M
Installed size: 57 M
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                       1/1
  Installing       : mimir-2.9.0-1.x86_64                                                  1/1
  Running scriptlet: mimir-2.9.0-1.x86_64                                                  1/1
 Post Install of an clean install
 Reload the service unit from disk
 Unmask the service
 Set the preset flag for the service unit
 Set the enabled flag for the service unit
Created symlink /etc/systemd/system/multi-user.target.wants/mimir.service → /usr/lib/systemd/system/mimir.service.

  Verifying        : mimir-2.9.0-1.x86_64                                                  1/1

Installed:
  mimir-2.9.0-1.x86_64

Complete!
[root@test mimir]# systemctl status mimir
● mimir.service - Horizontally scalable, highly available, multi-tenant, long term Prometheus.
   Loaded: loaded (/usr/lib/systemd/system/mimir.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2023-09-26 15:49:29 UTC; 3s ago
     Docs: https://grafana.com/oss/mimir/
 Main PID: 109244 (mimir)
    Tasks: 7 (limit: 42884)
   Memory: 23.0M
   CGroup: /system.slice/mimir.service
           └─109244 /usr/local/bin/mimir --config.file=/etc/mimir/config.yml --runtime-config.>

Sep 26 15:49:29 test mimir[109244]: ts=2023-09-26T15:49:29.732587506Z caller=compactor.go:580 >
Sep 26 15:49:29 test mimir[109244]: ts=2023-09-26T15:49:29.732670225Z caller=bucket_stores.go:>
Sep 26 15:49:29 test mimir[109244]: ts=2023-09-26T15:49:29.732709874Z caller=distributor.go:46>
Sep 26 15:49:29 test mimir[109244]: ts=2023-09-26T15:49:29.732737769Z caller=blocks_cleaner.go>
Sep 26 15:49:29 test mimir[109244]: ts=2023-09-26T15:49:29.732758435Z caller=blocks_cleaner.go>
Sep 26 15:49:29 test mimir[109244]: ts=2023-09-26T15:49:29.732794064Z caller=module_service.go>
Sep 26 15:49:29 test mimir[109244]: ts=2023-09-26T15:49:29.73281979Z caller=worker.go:232 leve>
Sep 26 15:49:30 test mimir[109244]: ts=2023-09-26T15:49:30.733627746Z caller=gateway.go:249 le>
Sep 26 15:49:30 test mimir[109244]: ts=2023-09-26T15:49:30.840099425Z caller=gateway.go:253 le>
Sep 26 15:49:30 test mimir[109244]: ts=2023-09-26T15:49:30.840205304Z caller=mimir.go:825 leve>
[root@test mimir]# yum install dist/mimir-2.10.0_amd64.rpm
Last metadata expiration check: 0:17:55 ago on Tue 26 Sep 2023 03:31:52 PM UTC.
Dependencies resolved.
===============================================================================================
 Package            Architecture        Version                Repository                 Size
===============================================================================================
Upgrading:
 mimir              x86_64              2.10.0-1               @commandline               21 M

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

Total size: 21 M
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                       1/1
  Upgrading        : mimir-2.10.0-1.x86_64                                                 1/2
  Running scriptlet: mimir-2.10.0-1.x86_64                                                 1/2
 Post Install of an upgrade
 Post Install of an upgrade
Warning: The unit file, source configuration file or drop-ins of mimir.service changed on disk. Run 'systemctl daemon-reload' to reload units.

  Running scriptlet: mimir-2.9.0-1.x86_64                                                  2/2
  Cleanup          : mimir-2.9.0-1.x86_64                                                  2/2
  Running scriptlet: mimir-2.9.0-1.x86_64                                                  2/2
  Verifying        : mimir-2.10.0-1.x86_64                                                 1/2
  Verifying        : mimir-2.9.0-1.x86_64                                                  2/2

Upgraded:
  mimir-2.10.0-1.x86_64

Complete!


[root@test mimir]# yum remove mimir
Dependencies resolved.
===============================================================================================
 Package            Architecture        Version               Repository                  Size
===============================================================================================
Removing:
 mimir              x86_64              2.10.0-1              @@commandline               61 M

Transaction Summary
===============================================================================================
Remove  1 Package

Freed space: 61 M
Is this ok [y/N]: y
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                       1/1
  Running scriptlet: mimir-2.10.0-1.x86_64                                                 1/1
Warning: The unit file, source configuration file or drop-ins of mimir.service changed on disk. Run 'systemctl daemon-reload' to reload units.

  Erasing          : mimir-2.10.0-1.x86_64                                                 1/1
  Running scriptlet: mimir-2.10.0-1.x86_64                                                 1/1
  Verifying        : mimir-2.10.0-1.x86_64                                                 1/1

Removed:
  mimir-2.10.0-1.x86_64

Complete!

@wilfriedroset wilfriedroset marked this pull request as ready for review September 26, 2023 16:14
Copy link
Contributor

@56quarters 56quarters left a comment

Choose a reason for hiding this comment

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

Thank you!

Signed-off-by: Wilfried Roset <wilfriedroset@users.noreply.github.com>
@56quarters 56quarters enabled auto-merge (squash) October 13, 2023 20:11
@56quarters 56quarters merged commit cb98ba1 into grafana:main Oct 13, 2023
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

uninstall old mimir version package fails on RHEL8
5 participants