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

Postrm script should not fail #11678

Merged
merged 1 commit into from Jul 1, 2015
Merged

Postrm script should not fail #11678

merged 1 commit into from Jul 1, 2015

Conversation

tlrx
Copy link
Member

@tlrx tlrx commented Jun 15, 2015

This commit changes the postrm script so that it prints error messages instead of failing & exiting when the deletion of directories failed while removing a RPM/DEB package.

Closes #11373

@tlrx tlrx added v2.0.0-beta1 review :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts v1.6.1 labels Jun 15, 2015
@tlrx
Copy link
Member Author

tlrx commented Jun 15, 2015

@spinscale can you have a look when you have time please? No hurry, thanks :)

fi
fi

if [ "$REMOVE_USER_AND_GROUP" = "true" ]; then
if id "$ES_USER" > /dev/null 2>&1 ; then
userdel "$ES_USER"
Copy link
Contributor

Choose a reason for hiding this comment

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

If you can delete the user/group usually means that there is still a process running under that user.
Doing this is bad practice in general :-)

Copy link
Member Author

Choose a reason for hiding this comment

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

I suppose you mean "If you can't" ?

Copy link
Contributor

Choose a reason for hiding this comment

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

sorry yes indeed. if you can't :-)

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok :)

Doing this is bad practice in general :-)

What's your suggestion here?

Copy link
Contributor

Choose a reason for hiding this comment

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

wondering about the same, userdel with a useful error message sounds good at first glance

This commit changes the postrm script so that it prints error messages instead of failing & exiting when the deletion of a directory failed while removing a RPM/DEB package.

Closes elastic#11373
@tlrx tlrx merged commit 737440b into elastic:master Jul 1, 2015
@kevinkluge kevinkluge removed the review label Jul 1, 2015
@tlrx
Copy link
Member Author

tlrx commented Jul 1, 2015

@electrical @spinscale I merged this without the userdel message error, leaving as it was before.

@tlrx tlrx deleted the postrm-do-not-fail branch July 8, 2015 13:17
@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts Team:Delivery Meta label for Delivery team v1.6.1 v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

deb package postrm script
6 participants