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 2095443 - [RFE] pacemaker use systemd-sysusers
Summary: [RFE] pacemaker use systemd-sysusers
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: pacemaker
Version: CentOS Stream
Hardware: All
OS: Linux
high
low
Target Milestone: rc
: 9.4
Assignee: Chris Lumens
QA Contact: cluster-qe
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-06-09 17:51 UTC by Pat Riehecky
Modified: 2023-09-22 19:39 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
This is invisible to end users
Clone Of:
Environment:
Last Closed: 2023-09-22 19:39:33 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 CLUSTERQE-6699 0 None None None 2023-05-16 14:17:36 UTC
Red Hat Issue Tracker   RHEL-7665 0 None Migrated None 2023-09-22 19:39:45 UTC
Red Hat Issue Tracker RHELPLAN-124878 0 None None None 2022-06-09 18:03:31 UTC

Description Pat Riehecky 2022-06-09 17:51:36 UTC
Description of problem:
pacemaker is using static useradd scripts

Version-Release number of selected component (if applicable):
pacemaker-2.1.3-2.el9

How reproducible:
100%

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

Actual results:
%pre -n %{pkgname_pcmk_libs}
# @TODO Use sysusers.d:
# https://fedoraproject.org/wiki/Changes/Adopting_sysusers.d_format
getent group %{gname} >/dev/null || groupadd -r %{gname} -g %{hacluster_id}
getent passwd %{uname} >/dev/null || useradd -r -g %{gname} -u %{hacluster_id} -s /sbin/nologin -c "cluster user" %{uname}
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 5 Ken Gaillot 2023-06-12 18:25:15 UTC
This has been done in Fedora and just needs to be backported to the RHEL/CentOS Stream spec

Comment 6 Klaus Wenninger 2023-06-13 09:49:22 UTC
Haven't yet checked from which RHEL/CentOS versions on the macros do meet our needs.
As seen in Fedora availability alone wasn't enough. At least - although the macro
was there - I didn't manage to get the desired combination of user & primary group
prior to f38.
Fortunately one doesn't even need to setup a virtual machine to test - the sandbox
container setup by mock should be sufficient.
Don't know if it is worth the effort to verify user/group in the CI-gating-tests
since they operate out of an rpm-installed setup.

Comment 7 Chris Lumens 2023-06-13 13:03:25 UTC
The "uid:gid" syntax in pacemaker.sysusers does not work on RHEL9 because sysusers.generate-pre.sh does not support that syntax.  A later patch in Fedora fixes this (https://src.fedoraproject.org/rpms/systemd/c/83301531c0aa22ffc155096826d8f5250c6a880a?branch=main), but the RHEL9 version is lacking it.  So we'll need to come up with a different way to accomplish the same thing.

Comment 8 Pat Riehecky 2023-06-13 13:12:27 UTC
Rather than put in a hack to support "forever" could that patch get into CentOS Stream 9 and mark this as dependent on that?

Comment 9 Chris Lumens 2023-06-13 13:47:59 UTC
I think all that's necessary is to change pacemaker.sysusers like so:

diff --git a/pacemaker.sysusers b/pacemaker.sysusers
index daadb96..5f768e5 100644
--- a/pacemaker.sysusers
+++ b/pacemaker.sysusers
@@ -1,3 +1,4 @@
 #Type  Name       ID            GECOS           Home directory      Shell
 g      haclient   189
-u      hacluster  189:haclient  "cluster user"  /var/lib/pacemaker  /sbin/nologin
+u      hacluster  189           "cluster user"  /var/lib/pacemaker  /sbin/nologin
+m      hacluster  haclient

@kwenning Thoughts?

Comment 10 Klaus Wenninger 2023-06-13 14:02:51 UTC
iirc that didn't make haclient the primary group for hacluster - but I might not remember correctly.

I'd say if the macro-thing does the trick for our needs without additional hacks we go for it.
So yes getting that fix from Fedora into CentOS would make that possible. If we need it at all.
Otherwise I would suggest not to invest too much into a mechanism that seems not to be accepted
by a majority of rpm/systemd-based distributions. We have had a hack in place already for years ;-)
On the other side I'm not sure how long-lived that approach is anyway since rpm 4.19 comes
with native support for taking care of users/groups. Didn't try that out though ... looking as if
defining the current macro to empty might just be enough. Still the question if rpm supports the
"uid:gid" syntax ... or some other mechanism that does the job for us ...
rpm seems to support a mechanism that doesn't require packaging pacemaker.sysusers ... just for
the case we should see a reason why that might be an issue for us.
On the other hand rpm 4.19 hasn't even made it into rawhide yet.

Comment 11 Chris Lumens 2023-06-13 18:06:10 UTC
The sysusers.generate-pre.sh script is provided by systemd, so that's the component where we would need a bug filed and a patch added.  If we don't have time for that, the easiest thing to do would be to simply kick this along to a later release and try to push for that patch to be included in the mean time.

Comment 13 Ken Gaillot 2023-06-28 13:50:51 UTC
As RHEL 9.3 will not have the necessary RPM macros, this is being bumped to 9.4.

The necessary changes have already been made in Fedora and can be used as a template.

Comment 16 RHEL Program Management 2023-09-22 19:37:45 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 17 RHEL Program Management 2023-09-22 19:39:33 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.