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

Fixed user deletion issue in rpm postuninstall scriptlet. #272

Merged
merged 3 commits into from
Jun 14, 2014
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions src/main/resources/com/typesafe/sbt/packager/rpm/postuninstall
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# Removing system user/group : ${{daemon_user}} and ${{daemon_group}}
echo "Try deleting system user and group [${{daemon_user}}:${{daemon_group}}]"
if getent passwd | grep -q "^${{daemon_user}}:";
if [[ $1 == 0 ]]
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for figuring that out! Can you place a comment there and maybe with the link?
Something like $1 == 1 is upgrade and $1 == 0 is uninstall

then
echo "Deleting system user: ${{daemon_user}}"
userdel ${{daemon_user}}
fi
if getent group | grep -q "^${{daemon_group}}:" ;
then
echo "Deleting system group: ${{daemon_group}}"
groupdel ${{daemon_group}}
echo "Try deleting system user and group [${{daemon_user}}:${{daemon_group}}]"
if getent passwd | grep -q "^${{daemon_user}}:";
then
echo "Deleting system user: ${{daemon_user}}"
userdel ${{daemon_user}}
fi
if getent group | grep -q "^${{daemon_group}}:" ;
then
echo "Deleting system group: ${{daemon_group}}"
groupdel ${{daemon_group}}
fi
fi