Skip to content

Conversation

@ellert
Copy link
Contributor

@ellert ellert commented Mar 23, 2025

See the last paragraph in this comment:

#2433 (comment)

With this tweak using the file in the tar ball works.

@amadio
Copy link
Member

amadio commented Mar 24, 2025

Is this really needed? I'm fine with the current solution of just installing the extra dependency on Alma 8. I wish I could depend on EPEL and friends in the spec file, but it seems this is a limitation of the system that I cannot really depend on it.

@ellert
Copy link
Contributor Author

ellert commented Mar 24, 2025

This is not about the installation of the sysusers file. This is about the pre installation scriptlet.

With the spec as is before the proposed change:

$ rpm -q --scripts -p xrootd-server-5.8.0-1.el9.x86_64.rpm 
preinstall program: /bin/sh

With the proposed change:

$ rpm -q --scripts -p xrootd-server-5.8.0-1.el9.x86_64.rpm 
preinstall scriptlet (using /bin/sh):

# generated from xrootd-sysusers.conf
getent group 'xrootd' >/dev/null || groupadd -r 'xrootd' || :
getent passwd 'xrootd' >/dev/null || \
    useradd -r -g 'xrootd' -d '/var/spool/xrootd' -s '/usr/sbin/nologin' -c 'XRootD runtime user' 'xrootd' || :

I.e. with the original version the scriptlet is not created because at the time the %pre section is evaluated, the source has not been unpacked yet and the information in it can not be used to create the scriptlet.

In Fedora 43 it is empty in both cases, because there the RPM version i super new, and knows how to create users and groups from the provides, but in older release, including RHEL, this is not the case and the scriptlet is needed.

Provides in EPEL 9 case:

$ rpm -q --provides -p xrootd-server-5.8.0-1.el9.x86_64.rpm | grep -E '(user|group)'
group(xrootd)
user(xrootd)

Provides in Fedora 43 case:

$ rpm -q --provides -p xrootd-server-5.8.0-1.fc43.x86_64.rpm | grep -E '(user|group)'
group(xrootd)
user(xrootd) = dSB4cm9vdGQgLSAiWFJvb3REIHJ1bnRpbWUgdXNlciIgL3Zhci9zcG9vbC94cm9vdGQgLQAA

$ echo dSB4cm9vdGQgLSAiWFJvb3REIHJ1bnRpbWUgdXNlciIgL3Zhci9zcG9vbC94cm9vdGQgLQAA | base64 -d
u xrootd - "XRootD runtime user" /var/spool/xrootd -

I.e. the provides contains the line from the sysusers file and RPM can create the user from the information in the provides and the scriptlet is not needed. But not for old versions of RPM like the one in RHEL 9. There the scriptlet is needed.

@amadio
Copy link
Member

amadio commented Mar 28, 2025

Thank you for the explanation. I understand why the change is necessary. I suggested a small improvement to not depend on _with_git for the extraction of the file, or its path inside the archive. If you approve the change, I can squash to your commit and merge it. Thanks!

@amadio amadio added this to the 5.8.1 milestone Mar 28, 2025
@amadio amadio merged commit 53474d9 into xrootd:master Mar 28, 2025
11 checks passed
@ellert ellert deleted the pre-before-prep branch March 28, 2025 14:51
@amadio amadio moved this to Done in Release Planning Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants