--- my_mongodb-3.2.0p2.ebuild 2015-12-16 18:25:45.233339542 -0500 +++ my_mongodb-3.2.0p3.ebuild 2015-12-16 19:35:21.413367214 -0500 @@ -67,8 +67,21 @@ die "Terminating ebuild." fi - enewgroup mongodb - enewuser mongodb -1 -1 /var/lib/${PN} mongodb + # If the user mongodb already exists we do not neeed + # to add these users to the system. If the user and + # group do not exist, we create them. + + getent group mongodb > /dev/null 2&>1 + + if [ "$?" -eq "1" ]; then + enewgroup mongodb + fi + + getent passwd mongodb > /dev/null 2&>1 + + if [ "$?" -eq "1" ]; then + enewuser mongodb -1 -1 /var/lib/${PN} mongodb + fi # Maintainer notes #