Issue #4990 has been updated by Todd Zullinger.
The spec file in conf/redhat matches what we ship in Fedora and EPEL. For those releases, the uid/gid are reserved, as noted in the spec file. If you already use those for something else, you should simply create a puppet user and group prior to installation and the rpm scriptlets will not try to create them. (If they do exist, the package should still install properly, minus the missing puppet user/group and incorrect ownership on some files/dirs. But I can't say I've tested this much, so if that's horribly broken, I'm open to making it less so.) I think it is a mistake to automatically take the next free uid/gid as they may also be reserved by some other package in the distribution (thus causing this exact problem for someone else ;). It's better to not use any of the uids or gids defined in /usr/share/doc/setup-*/uidgid At the least, the above change would not be acceptable in the Fedora/EPEL packages. So if it's applied in puppet.git, we'd have to do extra work to keep the spec file in sync. ---------------------------------------- Feature #4990: Update RPM SPEC file to use new UID if current User ID is in use https://projects.puppetlabs.com/issues/4990 Author: Chuck Schweizer Status: Needs design decision Priority: Low Assignee: Todd Zullinger Category: installation Target version: Affected version: Keywords: Branch: The following is very rough code of what would work for my environment. I would like this because UID/GID may already be taken by another application and I want the puppet user to still be created. --- puppet.spec.old 2010-10-12 11:20:43.000000000 -0500 +++ puppet.spec 2010-10-12 11:20:54.000000000 -0500 @@ -182,9 +182,26 @@ # Fixed uid/gid were assigned in bz 472073 (Fedora), 471918 (RHEL-5), # and 471919 (RHEL-4) %pre -getent group puppet &>/dev/null || groupadd -r puppet -g 52 &>/dev/null +DEFAULT_PUPPETID=52 +NEXT_ID=0 + +if getent group $DEFAULT_PUPPETID &>/dev/null || getent passwd $DEFAULT_PUPPETID &>/dev/null;then + ID_SCAN=$DEFAULT_PUPPETID + while (( NEXT_ID == 0 )) ;do + if getent group $ID_SCAN &>/dev/null || getent passwd $ID_SCAN &>/dev/null;then + (( ID_SCAN = ID_SCAN + 1 )) + else + NEXT_ID=$ID_SCAN + break + fi + done +else + NEXT_ID=$DEFAULT_PUPPETID +fi + +getent group puppet &>/dev/null || groupadd -r puppet -g $NEXT_ID &>/dev/null getent passwd puppet &>/dev/null || \ -useradd -r -u 52 -g puppet -d %{_localstatedir}/lib/puppet -s /sbin/nologin \ +useradd -r -u $NEXT_ID -g puppet -d %{_localstatedir}/lib/puppet -s /sbin/nologin \ -c "Puppet" puppet &>/dev/null || : # ensure that old setups have the right puppet home dir if [ $1 -gt 1 ] ; then -- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://projects.puppetlabs.com/my/account -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
