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

Please provide purge maintainer scriptlet #1224

Open
gebi opened this issue Nov 7, 2016 · 3 comments
Open

Please provide purge maintainer scriptlet #1224

gebi opened this issue Nov 7, 2016 · 3 comments

Comments

@gebi
Copy link

gebi commented Nov 7, 2016

Hi,

please support purge for the remove maintainer scripts.

The reason is that in debian the useful distinction exists between removing a package and purging it.
The core of that being, that remove does remove the software but NEVER touches the data, as data being useless and at risk of exposure when some package config is deleted (eg. the user) removing the package configuration is a separate step.

I understand that it's rarely needed in the cloud with stateless containers, but for stateful deployments it's crucial and by no way "fine-grained" as described in the generated set of maintainer scripts.

It also makes it easier/possible to generate debian packages with fpm which behave more in line with traditionally created debian packages AND reducing the probability of errors like #kibana/6262 in the kibana debian package which removes and re-adds it's own user on package upgrade.

fpm postrm purge scriptlet:

elif [ "${1}" = "purge" -a -z "${2}" ]
then
    # like "on remove", but executes after dpkg deletes config files
    # 'apt-get purge' runs 'on remove' section, then this section.
    # Maybe we ignore this; it seems really fine-grained.
    # There is no equivalent in RPM or ARCH. A debian-specific argument
    # might perhaps be used here, but most people
    # probably don't need it.
    dummy
elif [ "${1}" = "upgrade" ]
@jordansissel
Copy link
Owner

For this: elastic/kibana#6262

Seems like the problem described in the above kibana issue is less about apt-get purge and more about two things:

  • Don't do user management on package upgrades
  • A service needs to be stopped in order to upgrade.

The patch elastic/kibana#7308 seems to add these things for Kibana.

I'm of the opinion that packages should never manage users or services, but I understand that opinions can differ on this :)

I don't think purge is related to these problem, especially considering RPM has no concept of 'purge'.

I'm open to having fpm make it easier to set a specific purge script, but as stated in this comment, I am not seeing a link between purge and the problem reported in Kibana.

@gebi
Copy link
Author

gebi commented Nov 8, 2016

Yea, even just the option to set a purge script would be very helpful!

Would it be possible to add this?

@jordansissel
Copy link
Owner

Definitely possible. Areas that would get code would be possibly the scripts in https://github.com/jordansissel/fpm/tree/master/templates/deb and adding a new option to the deb package to let you set the script to run on purge.

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

No branches or pull requests

2 participants