Bug 2095424
| Summary: | [RFE] httpd use systemd-sysusers | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 9 | Reporter: | Pat Riehecky <riehecky> |
| Component: | httpd | Assignee: | Luboš Uhliarik <luhliari> |
| Status: | NEW --- | QA Contact: | rhel-cs-infra-services-qe <rhel-cs-infra-services-qe> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | CentOS Stream | CC: | bstinson, jonathan, jwboyer, luhliari |
| Target Milestone: | rc | Keywords: | FutureFeature |
| Target Release: | --- | ||
| 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: | 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: | |||
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.
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. (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. |
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