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

CPACK: add auto generated dbhelper maintainer scripts #8341

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

shaerpour
Copy link

@shaerpour shaerpour commented Jan 2, 2024

Description

This PR is completed version of #8330 that is closed. In Debian packages, we have maintainer scripts with (prerm, preinst, postrm and postinst) extensions that will run before or after extracting and installing package. They will do important tasks like adding user or creating directories for main app to run correctly.

Issues

The issue with fluent-bit deb packages is that it does not have this scripts so if someone activates and enables fluent-bit, after purging or removing package the OS still shows package is running and it can make issues during boot, etc.

Solution

In this branch, I added prerm, postinst and postrm scripts for resolving issue. Scripts are built with debhelper collection and customized some parts for better performance.

I already built and installed packages for ubuntu/20.04, debian/bullseye and debian/bookworm and they work totally fine.

Troubles

As mentioned, debhelper is a collection of tools for building deb packages. It creates different parts like maintainer scripts, systemd services and etc.
But the main problem was to match CPACK with it! They are different platforms for making deb packages and doing their own work so I couldn't connect them. I used CPackDebHelper inside fluent-bit codes but it just conflicts in many parts. At the end, I just built scripts with it and added statically in cpack/debian directory to be copied and used by systemd.

@aminvakil
Copy link

CI has failed:

NMAKE : fatal error U1052: file 'Makefile' not found
Stop.
Test project C:/projects/fluent-bit-2e87g/build
No tests were found!!!

cpack/debian/postinst Outdated Show resolved Hide resolved
cpack/debian/postrm Outdated Show resolved Hide resolved
cpack/debian/prerm Outdated Show resolved Hide resolved
@shaerpour shaerpour force-pushed the apt-maintainer-script-implementation branch 3 times, most recently from 346b8d0 to 0732c52 Compare January 2, 2024 10:41
@patrick-stephens
Copy link
Contributor

Is there any impact on the RPM packages and/or should we be doing the same?
It sounds like some kind of dirty state is left so it probably needs fixing for RPMs as well, which have an identical mechanism.

@shaerpour
Copy link
Author

shaerpour commented Jan 9, 2024

Is there any impact on the RPM packages and/or should we be doing the same? It sounds like some kind of dirty state is left so it probably needs fixing for RPMs as well, which have an identical mechanism.

I'm working on that but it needs more research, so it can take some time for building and deploying scripts. I will send another PR for them in the close future but it would be great if we fix debian packages sooner. @patrick-stephens

@shaerpour shaerpour force-pushed the apt-maintainer-script-implementation branch 2 times, most recently from 12699e7 to e1df359 Compare January 9, 2024 06:25
@aminvakil
Copy link

I'd suggest merging this PR if it fixes the package for deb users and let another rpm users send another PR, as we (me and @ahspw) do not have that much experience in rpm-based distros and it would be much better if someone with expertise and motivation in that scope creates a new PR about that.

@patrick-stephens
Copy link
Contributor

I think the commits have gone a bit wonky rather than be rebased

@shaerpour shaerpour force-pushed the apt-maintainer-script-implementation branch from d2c55d0 to add34dc Compare January 16, 2024 14:32
@shaerpour
Copy link
Author

I think the commits have gone a bit wonky rather than be rebased

Yes that was a mistake, I just fixed them

@shaerpour
Copy link
Author

Should I do anything for windows build action issue?

@shaerpour shaerpour force-pushed the apt-maintainer-script-implementation branch 2 times, most recently from 0dd4f68 to 9dedf5a Compare January 25, 2024 19:14
@shaerpour shaerpour force-pushed the apt-maintainer-script-implementation branch from 6f05c10 to 6b896d4 Compare February 12, 2024 06:39
@shaerpour shaerpour force-pushed the apt-maintainer-script-implementation branch from 6b896d4 to a65bd53 Compare February 19, 2024 07:15
Copy link
Contributor

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the Stale label May 21, 2024
@aminvakil
Copy link

@shaerpour Please tell me if you do not have time for this and want me to take over this PR.

Although this PR is good to go AFAICS and needs a maintainer attention.

@shaerpour shaerpour force-pushed the apt-maintainer-script-implementation branch from a65bd53 to a16b81f Compare May 28, 2024 19:06
@github-actions github-actions bot removed the Stale label Jun 8, 2024
Copy link
Contributor

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the Stale label Dec 14, 2024
@aminvakil
Copy link

This comment is only meant to prevent closing the PR.

@github-actions github-actions bot removed the Stale label Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants