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

Fix RPM System User Deletion on Upgrade #326

Merged
merged 1 commit into from
Aug 20, 2014
Merged

Conversation

pcting
Copy link
Contributor

@pcting pcting commented Aug 19, 2014

This is an extension to this commit to fix the RPM upgrade problem.

I've been having problems with my system user being deleted on an RPM upgrade. So I dug deeper and i found this problem:

$ rpm -qp --scripts  myrpm.noarch.rpm
... (stripped out unrelated stuff) ...
postuninstall scriptlet (using /bin/sh):
# Removing system user/group : XXX and XXX
echo "Try deleting system user and group [XXX:XXX]"
if getent passwd | grep -q "^XXX:"; 
then
    echo "Deleting system user: XXX"
    userdel XXX
fi
if getent group | grep -q "^XXX:" ;
then
    echo "Deleting system group: XXX"
    groupdel XXX
fi

So I copied the postuninstall into my project's /src/rpm/scriptlets/postun-rpm and the problem resolved itself.

It feels strange that there's multiple copies of the same script; I'm guessing some clean up will need to be done. Anyhow, here's a pull request that should fix the problem for the time being.

Thanks!

@lightbend-cla-validator

Hi @pcting,

Thank you for your contribution! We really value the time you've taken to put this together.

Before we proceed with reviewing this pull request, please sign the Typesafe Contributors License Agreement:

http://typesafe.com/contribute/cla

@muuki88 muuki88 added the rpm label Aug 20, 2014
@muuki88 muuki88 added this to the 0.8.0 - windows services milestone Aug 20, 2014
@muuki88
Copy link
Contributor

muuki88 commented Aug 20, 2014

Ah, I see. The main point for copying these files, was to keep the systemstart systems
separated. Uninstalling requires unregistering your application at some point. And before
creating a mix between shared and non-shared scripts, we separated them completely.

However IMHO we should at somepoint consolidate things. So we built up custom scripts from
common blocks. @kardapoltsev

@muuki88
Copy link
Contributor

muuki88 commented Aug 20, 2014

Ah, I see. Thanks for the fix.

The main goal at the beginning was to keep bootup-systems separated. You need
custom register/unregister methods in the lifecycle-scripts. So before creating a
mess we kept them separated.

However, now we gained a lot more insights, we should consolidate them in a way
that custom scripts are built from common blocks. @kardapoltsev what do you think?

muuki88 added a commit that referenced this pull request Aug 20, 2014
Fix RPM System User Deletion on Upgrade
@muuki88 muuki88 merged commit b6dbe19 into sbt:master Aug 20, 2014
@muuki88
Copy link
Contributor

muuki88 commented Aug 20, 2014

merged into v0.7.x

@muuki88 muuki88 added the v0.7.x label Aug 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants