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

Move chrony config from generator to systemd service #2271

Merged
merged 1 commit into from Mar 6, 2023
Merged

Move chrony config from generator to systemd service #2271

merged 1 commit into from Mar 6, 2023

Conversation

gursewak1997
Copy link
Member

@gursewak1997 gursewak1997 commented Mar 2, 2023

With the latest changes from systemd, we now run certain steps before NetworkManager.service to access and write to /etc/sysconfig/network. We completely got rid of the usage of generators.

Issue: coreos/fedora-coreos-tracker#1402

@dustymabe
Copy link
Member

Unfortunately this is getting complicated :(

Long-term, we are looking to eliminate that file entirely and just use systemd unit service.

Can you expand on the strategy there?

I'm thinking 1. maybe we should push harder to get everything out of a generator now OR 2. take a more tactical approach to updating /etc/sysconfig/network and leave most of the logic in the generator for now (until we can get rid of it completely.

I actually have ideas on how we can achieve either 1. or 2.. Maybe we can discuss it tomorrow.

dustymabe
dustymabe previously approved these changes Mar 3, 2023
Copy link
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

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

A few small comment fixups.. otherwise LGTM

How did this perform in testing?

@dustymabe
Copy link
Member

looking at the CI failure we probably need to delete the coreos-platform-chrony-generator-permissions test now that we no longer have a generator.

dustymabe
dustymabe previously approved these changes Mar 3, 2023
Copy link
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

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

LGTM - tagging in @jlebon for a second pair of eyes.

@@ -0,0 +1,13 @@
[Unit]
Description=Configure chrony based on the platform
Copy link
Member

Choose a reason for hiding this comment

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

Minor: we usually prefix our units with "CoreOS". Also, the convention for systemd unit descriptions is Title Case.

Copy link
Member Author

Choose a reason for hiding this comment

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

Can you elaborate on the description part? Also, don't we already have "coreos" as the prefix for this service?

Copy link
Member

Choose a reason for hiding this comment

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

I think he's saying that we usually prefix our units with CoreOS in the description so that in the logs it's clear to us that it's one of our systemd units we defined.

Based on his suggestion something like:

CoreOS Configure Chrony Based On The Platform

Would work.

Comment on lines 23 to 24
confpath=/run/coreos-platform-chrony.conf
altenvfilepath=/run/sysconfig-coreos-chrony
Copy link
Member

Choose a reason for hiding this comment

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

While we're here, I wonder if we should put these under /run/coreos instead? (And drop the coreos in the basename.) Now that it's two files, it starts to look a bit messy putting it in the top-level.

# Read in the existing $OPTIONS variable setting from /etc/sysconfig/chrony
# and write out a new $OPTIONS variable (with specified new configuration path)
# to /run/sysconfig-coreos-chrony
source ${altenvfilepath}
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be /etc/sysconfig/chronyd?

Copy link
Member

Choose a reason for hiding this comment

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

this still needs to be updated

ExecStart=
ExecStart=/usr/sbin/chronyd -f ${confpath} \$OPTIONS
EOF
# Read in the existing $OPTIONS variable setting from /etc/sysconfig/chrony
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# Read in the existing $OPTIONS variable setting from /etc/sysconfig/chrony
# Read in the existing $OPTIONS variable setting from /etc/sysconfig/chronyd

@jlebon
Copy link
Member

jlebon commented Mar 3, 2023

Just noticed this PR is targeting the rawhide branch. It needs to target testing-devel. Were there concerns with doing this change in f37?

@dustymabe
Copy link
Member

Just noticed this PR is targeting the rawhide branch. It needs to target testing-devel. Were there concerns with doing this change in f37?

good catch. Yes, this should target testing-devel.

@gursewak1997 gursewak1997 changed the base branch from rawhide to testing-devel March 3, 2023 22:14
@gursewak1997
Copy link
Member Author

With the recent changes, the basic test passes but the ext.config.ntp.chrony.coreos-platform-chrony-generator fails. The CI here isn't testing that as this test only runs on aws azure gce. Working on the fix as the logs aren't helping much.

@dustymabe
Copy link
Member

With the recent changes, the basic test passes but the ext.config.ntp.chrony.coreos-platform-chrony-generator fails. The CI here isn't testing that as this test only runs on aws azure gce. Working on the fix as the logs aren't helping much.

For one, this still needs to be addressed: https://github.com/coreos/fedora-coreos-config/pull/2271/files#r1124818300

Comment on lines 3 to 4
[Service]
EnvironmentFile=-/etc/sysconfig/chronyd
Copy link
Member

Choose a reason for hiding this comment

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

this should go back to the value it was before.

if ! cmp {/usr,}/etc/chrony.conf >/dev/null; then
echo "$self: /etc/chrony.conf is modified; not changing the default"
exit 0
fi

confpath=/run/coreos/platform-chrony.conf
altenvfilepath=/etc/sysconfig/chronyd
Copy link
Member

Choose a reason for hiding this comment

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

This should go back to the value it was before

# Read in the existing $OPTIONS variable setting from /etc/sysconfig/chronyd
# and write out a new $OPTIONS variable (with specified new configuration path)
# to /etc/sysconfig/chronyd
source ${altenvfilepath}
Copy link
Member

Choose a reason for hiding this comment

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

This should say source /etc/sysconfig/chronyd

With latest changes from systemd, we now run certain
steps before NetworkManager.service to access and write
to /etc/sysconfig/network.
Issue: coreos/fedora-coreos-tracker#1402
Copy link
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

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

LGTM if the tests pass!

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.

None yet

3 participants