Skip to content

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

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion quattor/aii/server/config.pan
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,23 @@ variable AII_DHCP_DHCPD_CONF_FILE ?= '/etc/dhcpd.conf';

include 'components/aiiserver/config';

# aii-shellfe configuration
# 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!).

SELF['type'] = 'socket';
SELF['state'] = 'enabled';
SELF['startstop'] = true;
};

if ( is_defined(SELF) ) {
SELF;
} else {
null;
};
};

# aii-shellfe configuration

prefix '/software/components/aiiserver/aii-shellfe';

Expand Down
Loading