Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quattor/server/config: enable tftpd service on EL9 #239

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jouvin
Copy link
Contributor

@jouvin jouvin commented Dec 16, 2024

This change should have been upstreamed before 24.10 release. Required for a working AII server on EL9.

@jouvin jouvin added this to the 25.next milestone Dec 16, 2024
@jouvin jouvin requested a review from jrha December 16, 2024 17:22
quattor/aii/server/config.pan Outdated Show resolved Hide resolved
# Enable tftpd (on EL9 only for backward compatibility)
include 'components/systemd/config';
'/software/components/systemd/unit/tftp' = {
if ( OS_VERSION_PARAMS['majorversion'] >= '9' ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'9' should be 9 instead? I suspect string comparison doesn't work with '10' and higher?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right but for discussable reasons this parameter has been defined as a string (to allow number that may have included a letter or dot, e.g. 9.1) and the end result is what you are saying. I'm afraid there are several places to fix in the template library and probably a way of doing it would be to implement a function to compare OS versions that would do the proper massaging... I am not clear whether we should already avoid to propagate the problem here or if we should have an issue to fix it properly (and if possible using the same approach) everywhere this test is present in the template library... I'm open!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would pkg_compare_version not do the job?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with OS_VERSION_PARAMS and complete agree that overall versioning needs to take things like 8.8 into account. However I would assume that "major version" would only be the first part as an int? i.e. in MS we have similar fields and they are constructed by selecting out the first int before a dot or other character from the overall version.

Assuming this isn't trivially fixable in the templates then maybe a quick hack here would be (untested):

if( to_long(OS_VERSION_PARAMS['majorversion']) >= 9 ) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ned21 I agree with you. The proposed hack would work as major version is currently only something that can be converted to a number. It may not work if at some point we decide to put something that cannot be converted. Thus my proposal to implement a function like get_os_major_version() that would return a number after doing whatever is necessary with OS_VERSION_PARAMS['majorversion']...

Copy link
Contributor Author

@jouvin jouvin Dec 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Proposal open as an issue: #242. I suggest to merge this PR as it is and to update the template (and others affected) once the function is available (and before RHEL 10!).

@jouvin
Copy link
Contributor Author

jouvin commented Dec 17, 2024

panlint and indentation errors have been fixed as part of #238. I suggest merging it first and I'll rebase this one to clean the errors.

@jrha
Copy link
Member

jrha commented Dec 17, 2024

#238 is merged now

@jouvin jouvin force-pushed the aii_server_el9_enable_tftpd branch from a37b865 to e3e59e9 Compare December 17, 2024 19:13
@jouvin jouvin force-pushed the aii_server_el9_enable_tftpd branch from e3e59e9 to 0841f16 Compare December 17, 2024 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants