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
Move chrony config from generator to systemd service #2271
Conversation
Unfortunately this is getting complicated :(
Can you expand on the strategy there? I'm thinking I actually have ideas on how we can achieve either |
overlay.d/20platform-chrony/usr/lib/systemd/system/coreos-platform-chrony-config.service
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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?
...lay.d/20platform-chrony/usr/lib/systemd/system/chronyd.service.d/coreos-platform-chrony.conf
Outdated
Show resolved
Hide resolved
looking at the CI failure we probably need to delete the |
There was a problem hiding this 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
confpath=/run/coreos-platform-chrony.conf | ||
altenvfilepath=/run/sysconfig-coreos-chrony |
There was a problem hiding this comment.
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} |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Read in the existing $OPTIONS variable setting from /etc/sysconfig/chrony | |
# Read in the existing $OPTIONS variable setting from /etc/sysconfig/chronyd |
Just noticed this PR is targeting the |
good catch. Yes, this should target |
With the recent changes, the |
For one, this still needs to be addressed: https://github.com/coreos/fedora-coreos-config/pull/2271/files#r1124818300 |
[Service] | ||
EnvironmentFile=-/etc/sysconfig/chronyd |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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} |
There was a problem hiding this comment.
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
There was a problem hiding this 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!
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