apache ebuild 1.3.24-r1 tests for "apache" user and group existing only in /etc/passwd and /etc/group. If someone is using a different user source, let's say for example...LDAP, then the apache group and user may not exist in /etc/passwd and /etc/group. However, apache IS a valid user and group, and the subsequent call to groupadd and useradd will fail, which causes the entire ebuild to abort. Perhaps testing with id apache would work, or checking the response from groupadd and useradd. I commented out the groupadd/useradd in the ebuild to "force" the install, so have worked around the issue in the short term.
good point; having not really gotten into ldap i didn't realize this. so will changing the checks to: if ! id -g apache ; then ... if ! id -u apache ; then ... make it friendlier? theres a few more ebuilds doing this sort of thing, so it'd be good to find a nice generic solution here. im guessing this is the way to go, but i'll wait for your reply. thanks.
note that the new check would be: if ! id -u apache >/dev/null 2>&1 ; then ... and similar for the group.
bleh id -g foobar doesnt do what i guessed it does. bummer, i need a nice, generic way to test for existing groups that is LDAP friendly. any suggestions welcome.
I'm sure the emails to me bounced - apologies. What do you think of this: if ! groupadd -g 81 apache ; then die "problem adding group apache" fi and the same for useradd?
Problem with that is it'll fail for most people using /etc/group; since apache:81 is already in the Gentoo baselayout /etc/group file :/ id -u apache for the user check sounded good i guess, unfortunately i dunno what to do about the group. fortunately it doesnt seem like a major issue, still i'd like to smooth it out if you have any further ideas ;)
Should be fixed in apache 1.3.24-r6 if ! groupmod apache; then ... fi if ! id apache; then ... fi
Nope. Not fixed. I just tried to update my apache, and got this error on install: adamantium root # emerge --update world Calculating world dependencies ...done! >>> emerge net-www/apache-1.3.24-r6 to / >>> md5 ;-) apache_1.3.24.tar.gz >>> md5 ;-) mod_ssl-2.8.8-1.3.24.tar.gz uid=1001(apache) gid=407 groups=407 useradd: user apache exists !!! ERROR: The ebuild did not complete successfully. !!! Function pkg_setup, Line 9, Exitcode 9 !!! problem adding user apache !!! emerge aborting on /usr/portage/net-www/apache/apache-1.3.24-r6.ebuild .
This works fine over here on non-ldap... Can you do and post these here... id root &>/dev/null; echo "-- id root: $?" id zsp234 &>/dev/null; echo "-- id zsp234: $?" id apache &>/dev/null; echo "-- id apache: $?"
id root &>/dev/null; echo "-- id root: $?" -- id root: 0 id zsp234 &>/dev/null; echo "-- id zsp234: $?" -- id zsp234: 1 id apache &>/dev/null; echo "-- id apache: $?" -- id apache: 1
Did you have Apache installed on that box? Did you have user 'apache' on that box? Do you know of a way to check for ldap users? Do you know how to query for their information that would normally exist in /etc/passwd? (hopefully these will actually work) Try these and post the results please: usermod root; echo $? usermod apache; echo $? usermod SOME_LDAP_USERNAME; echo $?
akira root # usermod root; echo $? usermod: no flags given 2 akira root # usermod apache; echo $? usermod: no flags given 2 akira root # usermod rectrix; echo $? usermod: no flags given 2 akira root # usermod foo; echo $? usermod: user foo does not exist 6 akira root #
apache-1.3.26-r1 -- is another shot at fixing the problem. Lemme know the results. If it's not in portage yet, give it a couple minutes. Please, if you have any ldap tools for user editing, let me know what they are and how they work. It'd help to solve the issue.
Works fine for me now.