RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1442872 - apache user is not created during httpd installation when apache group already exist with GID other than 48
Summary: apache user is not created during httpd installation when apache group alread...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: httpd
Version: 7.3
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Luboš Uhliarik
QA Contact: Jan Houska
URL:
Whiteboard:
Depends On:
Blocks: 1298243 1669074
TreeView+ depends on / blocked
 
Reported: 2017-04-17 20:06 UTC by James Hartsock
Modified: 2020-12-14 08:32 UTC (History)
3 users (show)

Fixed In Version: httpd-2.4.6-64.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1487164 1669074 (view as bug list)
Environment:
Last Closed: 2017-08-01 21:36:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:2175 0 normal SHIPPED_LIVE httpd bug fix update 2017-08-01 18:40:47 UTC

Description James Hartsock 2017-04-17 20:06:09 UTC
Description of problem:

When installing httpd via yum and apache group already exists on the system with GID other than 48 (for example when it is defined in IDM), installation is not able to create apache user because '-g 48' is used on RHEL 7.

This worked in RHEL 6 because '-g apache' was utilized.  Now that BZ 1299889 has split the group & user creation into individual commands, believe useradd should be modified to use '-g apache' in RHEL 7 (as it is already in RHEL 6).


Version-Release number of selected component (if applicable):
httpd-2.4.6-45.el7

How reproducible:
Very

Steps to Reproduce:
1. Make apache group resolvable, but do NOT use GID=48.  Generally this would be resolved from IDM, but here just using local user to replicate issue.
   # groupadd -g 4800 apache

2. Install httpd
   # yum install httpd


Actual results
NOTE: useradd -g 48 (like RHEL 7 httpd preinstall)
# getent passwd apache
# getent group apache
apache:x:4800:

# /usr/sbin/useradd -c "Apache" -u 48 -g 48 -s /sbin/nologin -r -d /usr/share/httpd apache
useradd: group '48' does not exist




Expected results:
NOTE: useradd -g apache (like RHEL 6 httpd preinstall)

# getent passwd apache
# getent group apache
apache:x:4800:

# getent passwd apache >/dev/null || useradd -r -u 48 -g apache -s /sbin/nologin -d /var/www -c "Apache" apache

# echo $?
0



Additional info:

Comment 6 Jan Houska 2017-04-28 15:31:32 UTC
Verified


New PASS:
httpd-2.4.6-64.el7.x86_64

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: Changes of apache user.
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [  BEGIN   ] :: Running 'yum install -y httpd &> install_Output.log '
:: [   PASS   ] :: Command 'yum install -y httpd &> install_Output.log ' (Expected 0, got 0)
httpd-2.4.6-64.el7.x86_64
:: [   PASS   ] :: Checking for the presence of httpd rpm 
:: [ 11:27:13 ] :: Package versions:
:: [ 11:27:13 ] ::   httpd-2.4.6-64.el7.x86_64
============output of install_Output.log===========
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.4.6-64.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package         Arch             Version                  Repository      Size
================================================================================
Installing:
 httpd           x86_64           2.4.6-64.el7             rhel           1.2 M

Transaction Summary
================================================================================
Install  1 Package

Total download size: 1.2 M
Installed size: 3.7 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
** Found 3 pre-existing rpmdb problem(s), 'yum check' output follows:
httpd-CoreOS-httpd-Library-http-1.0-43.noarch has missing requires of httpd
1:mod_ssl-2.4.6-64.el7.x86_64 has missing requires of httpd = ('0', '2.4.6', '64.el7')
1:mod_ssl-2.4.6-64.el7.x86_64 has missing requires of httpd-mmn = ('0', '20120211x8664', None)
  Installing : httpd-2.4.6-64.el7.x86_64                                    1/1 
  Verifying  : httpd-2.4.6-64.el7.x86_64                                    1/1 

Installed:
  httpd.x86_64 0:2.4.6-64.el7                                                   

Complete!
===========/output of install_Output.log===========
./runtest.sh: line 87: rlIsRhel: command not found
:: [  BEGIN   ] :: Running 'getent group apache > output_group.log'
:: [   PASS   ] :: Command 'getent group apache > output_group.log' (Expected 0, got 0)
============output of output_group.log===========
apache:x:6800:
===========/output of output_group.log===========
:: [   PASS   ] :: File 'output_group.log' should contain 'apache:x:6800' 
:: [   PASS   ] :: Group apache exists. 
:: [  BEGIN   ] :: Running 'getent passwd apache > output_passwd.log'
:: [   PASS   ] :: Command 'getent passwd apache > output_passwd.log' (Expected 0, got 0)
============output of output_passwd.log===========
apache:x:48:6800:Apache:/usr/share/httpd:/sbin/nologin
===========/output of output_passwd.log===========
:: [   PASS   ] :: File 'output_passwd.log' should contain 'apache:x:48:6800' 
:: [   PASS   ] :: There is password for apache group. 

::::::::


Old FAIL:
httpd-2.4.6-45.el7.x86_64


::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: Changes of apache user.
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [  BEGIN   ] :: Running 'yum install -y httpd &> install_Output.log '
:: [   PASS   ] :: Command 'yum install -y httpd &> install_Output.log ' (Expected 0, got 0)
httpd-2.4.6-45.el7.x86_64
:: [   PASS   ] :: Checking for the presence of httpd rpm 
:: [ 11:29:13 ] :: Package versions:
:: [ 11:29:13 ] ::   httpd-2.4.6-45.el7.x86_64
============output of install_Output.log===========
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.4.6-45.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package         Arch             Version                  Repository      Size
================================================================================
Installing:
 httpd           x86_64           2.4.6-45.el7             rhel           1.2 M

Transaction Summary
================================================================================
Install  1 Package

Total download size: 1.2 M
Installed size: 3.7 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
** Found 3 pre-existing rpmdb problem(s), 'yum check' output follows:
httpd-CoreOS-httpd-Library-http-1.0-43.noarch has missing requires of httpd
1:mod_ssl-2.4.6-45.el7.x86_64 has missing requires of httpd = ('0', '2.4.6', '45.el7')
1:mod_ssl-2.4.6-45.el7.x86_64 has missing requires of httpd-mmn = ('0', '20120211x8664', None)
  Installing : httpd-2.4.6-45.el7.x86_64                                    1/1 
warning: user apache does not exist - using root
warning: user apache does not exist - using root
warning: user apache does not exist - using root
warning: user apache does not exist - using root
  Verifying  : httpd-2.4.6-45.el7.x86_64                                    1/1 

Installed:
  httpd.x86_64 0:2.4.6-45.el7                                                   

Complete!
===========/output of install_Output.log===========
./runtest.sh: line 87: rlIsRhel: command not found
:: [  BEGIN   ] :: Running 'getent group apache > output_group.log'
:: [   PASS   ] :: Command 'getent group apache > output_group.log' (Expected 0, got 0)
============output of output_group.log===========
apache:x:6800:
===========/output of output_group.log===========
:: [   PASS   ] :: File 'output_group.log' should contain 'apache:x:6800' 
:: [   PASS   ] :: Group apache exists. 
:: [  BEGIN   ] :: Running 'getent passwd apache > output_passwd.log'
:: [   FAIL   ] :: Command 'getent passwd apache > output_passwd.log' (Expected 0, got 2)
============output of output_passwd.log===========
===========/output of output_passwd.log===========
:: [   FAIL   ] :: File 'output_passwd.log' should contain 'apache:x:48:6800' 
:: [   FAIL   ] :: There is NO password for apache group! 

::::::::

Comment 7 errata-xmlrpc 2017-08-01 21:36:44 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:2175


Note You need to log in before you can comment on or make changes to this bug.