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 2095424

Summary: [RFE] httpd use systemd-sysusers
Product: Red Hat Enterprise Linux 9 Reporter: Pat Riehecky <riehecky>
Component: httpdAssignee: Luboš Uhliarik <luhliari>
Status: CLOSED MIGRATED QA Contact: rhel-cs-infra-services-qe <rhel-cs-infra-services-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: CentOS StreamCC: bstinson, jonathan, jwboyer, luhliari
Target Milestone: rcKeywords: FutureFeature, MigratedToJIRA
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-21 18:56:56 UTC Type: Story
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Pat Riehecky 2022-06-09 17:25:02 UTC
Description of problem:
httpd is using static useradd scripts

Version-Release number of selected component (if applicable):
httpd-2.4.53-2.el9

How reproducible:
100%

Steps to Reproduce:
1.review %pre
2.
3.

Actual results:
%pre filesystem
getent group apache >/dev/null || groupadd -g 48 -r apache
getent passwd apache >/dev/null || \
  useradd -r -u 48 -g apache -s /sbin/nologin \
    -d %{contentdir} -c "Apache" apache
exit 0

Expected results:
use of system-sysusers 

Additional info:
https://www.freedesktop.org/software/systemd/man/systemd-sysusers.html
https://fedoraproject.org/wiki/Changes/Adopting_sysusers.d_format

Comment 2 Luboš Uhliarik 2022-11-15 20:41:07 UTC
Hi Pat,

Do you have any more knowledge regarding this request?

I was trying to adopt this new format with new macros, but then I found out that it is not so 
easy (or at least I don't know how) to change the content in sysusers.d file before it is 
processed by the RPM macro processor.

It would be nice, if I can in %prep section modify the sysuser file by e.g. sed, but so far 
it looks like that the macro in %pre section (%sysusers_create_compat httpd.sysusers) is expanded 
before %prep.

There is a possibility to hardcode e.g. %{nginx_user} into sysusers.d file or %{contentdir} in case 
of httpd apache, but if you change this variable in the spec file, it won't properly change in 
sysusers.d file.

Comment 3 Pat Riehecky 2022-11-15 20:48:01 UTC
I'll confess I don't have specific detailed knowledge on this front.  I'm mostly going off the fedora guidelines and looking for places to help homoginize the behaviors.

Comment 4 Jonathan Wright 2023-07-05 21:39:00 UTC
@luhliari https://gitlab.com/redhat/centos-stream/rpms/httpd/-/merge_requests/75

Comment 5 Luboš Uhliarik 2023-07-11 09:21:23 UTC
(In reply to Jonathan Wright from comment #4)
> @luhliari
> https://gitlab.com/redhat/centos-stream/rpms/httpd/-/merge_requests/75

Hello Jonathan, I have similar change ready locally, but from what I know there is no option to use vars/params in systemd-sysusers file. I wanted to have in sysusers file something like:

---
g apache 48
u apache 48 "Apache" @CONTENTDIR@ /sbin/nologin
---


Because content dir can vary based on contentdir macro value definition on the top of the httpd.spec file:

define contentdir %{_datadir}/httpd


So far I could not find any way how to process that file before it is processed by %sysusers_create_compat macro.

Comment 6 RHEL Program Management 2023-09-21 18:51:46 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 7 RHEL Program Management 2023-09-21 18:56:56 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.