This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
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 - [RFE] httpd use systemd-sysusers
Summary: [RFE] httpd use systemd-sysusers
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: httpd
Version: CentOS Stream
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Luboš Uhliarik
QA Contact: rhel-cs-infra-services-qe
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-06-09 17:25 UTC by Pat Riehecky
Modified: 2023-09-21 18:56 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-09-21 18:56:56 UTC
Type: Story
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker   RHEL-6575 0 None Migrated None 2023-09-21 19:06:23 UTC
Red Hat Issue Tracker RHELPLAN-124861 0 None None None 2022-06-09 17:34:56 UTC

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.


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