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

Systemd service stopped and disabled after rpm package update #799

Open
netsandbox opened this issue Jan 17, 2025 · 1 comment · May be fixed by #800
Open

Systemd service stopped and disabled after rpm package update #799

netsandbox opened this issue Jan 17, 2025 · 1 comment · May be fixed by #800
Labels
artifact:rpm Issues related to RPM packages bug Something isn't working

Comments

@netsandbox
Copy link

I recently updated our otelcol-contrib rpm package from version 0.112.0 to 0.117.0 and noticed that after the update the otelcol-contrib systemd service was stopped and disabled.

As you can see in https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#ordering, is first executed the postinstall (post) of the previous package version (4.) and then the preuninstall (preun) of the new package version (9.).

In the here generated rpm package is first the otelcol-contrib service enabled and started in the postinstall of the previous version, and then stopped and disabled in the preuninstall of the new version.

The deb package seams to be not affected, because regarding https://wiki.debian.org/MaintainerScripts#Upgrading is there first executed the preuninstall (prerm) of the previous version and then the postinstall (postinst) of the new version.

I will later create a PR for this.

@dosubot dosubot bot added artifact:rpm Issues related to RPM packages bug Something isn't working labels Jan 17, 2025
@netsandbox
Copy link
Author

I also just noticed, that the systemd service is started after a package update.
If the service was already running before the package update, the service will still be running with the old version.
A restart is here needed.

I will also fix this in my PR.

netsandbox added a commit to netsandbox/opentelemetry-collector-releases that referenced this issue Jan 17, 2025
@netsandbox netsandbox linked a pull request Jan 17, 2025 that will close this issue
netsandbox added a commit to netsandbox/opentelemetry-collector-releases that referenced this issue Jan 20, 2025
* reload systemd daemon to make it aware of an updated service file
  after package update
* restart service to use the new binary after a package update
* don't stop and disable service after rpm package update

fixes open-telemetry#799
netsandbox added a commit to netsandbox/opentelemetry-collector-releases that referenced this issue Jan 20, 2025
* reload systemd daemon to make it aware of an updated service file
  after package update
* restart service to use the new binary after a package update
* don't stop and disable service after rpm package update

fixes open-telemetry#799
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
artifact:rpm Issues related to RPM packages bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant