Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 2050888

Summary: httpd with SSL fails to start unless hostname command was installed
Product: Red Hat Enterprise Linux 8 Reporter: Michael DePaulo <mikedep333>
Component: httpdAssignee: Luboš Uhliarik <luhliari>
Status: CLOSED ERRATA QA Contact: Branislav Náter <bnater>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: CentOS StreamCC: bstinson, jorton, jwboyer, luhliari, mosvald
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: httpd-2.4-8080020221213105150.fd72936b Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-16 08:28:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Michael DePaulo 2022-02-04 20:56:41 UTC
On the centos:stream8 container image, the `hostname` command ("hostname" package) is not installed.

If you go to install httpd with mod_ssl, and then start the httpd service, it fails to start.

The journal logs:

Feb 04 20:18:56 centos-8 systemd[1]: Starting One-time temporary TLS key generation for httpd.service...
Feb 04 20:18:56 centos-8 systemd[1]: systemd-journald.service: Failed to add fd to store: Operation not permitted
Feb 04 20:18:56 centos-8 httpd-ssl-gencerts[4562]: /usr/libexec/httpd-ssl-gencerts: line 5: hostname: command not found
Feb 04 20:18:56 centos-8 systemd[1]: httpd-init.service: Main process exited, code=exited, status=127/n/a
Feb 04 20:18:56 centos-8 systemd[1]: httpd-init.service: Failed with result 'exit-code'.
Feb 04 20:18:56 centos-8 systemd[1]: Failed to start One-time temporary TLS key generation for httpd.service.
Feb 04 20:18:56 centos-8 systemd[1]: Starting The Apache HTTP Server...
Feb 04 20:18:56 centos-8 systemd[1]: systemd-journald.service: Failed to add fd to store: Operation not permitted
Feb 04 20:18:57 centos-8 httpd[4563]: AH00526: Syntax error on line 85 of /etc/httpd/conf.d/ssl.conf:
Feb 04 20:18:57 centos-8 httpd[4563]: SSLCertificateFile: file '/etc/pki/tls/certs/localhost.crt' does not exist or is empty
Feb 04 20:18:57 centos-8 systemd[1]: httpd.service: Main process exited, code=exited, status=1/FAILURE
Feb 04 20:18:57 centos-8 systemd[1]: httpd.service: Failed with result 'exit-code'.
Feb 04 20:18:57 centos-8 systemd[1]: Failed to start The Apache HTTP Server.

Comment 1 Michael DePaulo 2022-02-07 14:31:16 UTC
To clarify: As seen in the log, the bug is that /usr/libexec/httpd-ssl-gencerts tries to call the `hostname` command.

But there is no dependency on the "hostname" package.

Comment 3 Joe Orton 2022-11-01 13:00:18 UTC
Confirming this is fixed in EL9 already:

https://gitlab.com/redhat/centos-stream/rpms/httpd/-/blob/c9s/httpd.spec#L215

Comment 6 Justin VandeBrake 2022-11-23 19:41:24 UTC
Just ran into this dependency problem on RHEL 8 while creating a minimized OS for our mission critical workloads.  A quick scan of the RPMs we test against indicates that none of the RPMs we use from RedHat or elsewhere express a dependency on `hostname,` it is unlikely that this is the only package which should have a dependency on the `hostname` rpm and does not.

Comment 22 errata-xmlrpc 2023-05-16 08:28:23 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 (httpd:2.4 bug fix and enhancement update), 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-2023:2789