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

fix: service_timesyncd_configured #11410

Merged

Conversation

Whidix
Copy link
Contributor

@Whidix Whidix commented Jan 2, 2024

If timesync.d directory does not exist the script failed to apply

Description:

  • Check if the directory under /etc/systemd/timesync.d exist, if not create it

If timesync.d directory the script failed to apply
@openshift-ci openshift-ci bot added the needs-ok-to-test Used by openshift-ci bot. label Jan 2, 2024
Copy link

openshift-ci bot commented Jan 2, 2024

Hi @Whidix. Thanks for your PR.

I'm waiting for a ComplianceAsCode member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link

github-actions bot commented Jan 2, 2024

Start a new ephemeral environment with changes proposed in this pull request:

sle12 (from CTF) Environment (using Fedora as testing environment)
Open in Gitpod

Fedora Testing Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

Copy link

github-actions bot commented Jan 2, 2024

This datastream diff is auto generated by the check Compare DS/Generate Diff

Click here to see the full diff
bash remediation for rule 'xccdf_org.ssgproject.content_rule_service_timesyncd_configured' differs.
--- xccdf_org.ssgproject.content_rule_service_timesyncd_configured
+++ xccdf_org.ssgproject.content_rule_service_timesyncd_configured
@@ -18,6 +18,11 @@
     sed -i 's/^NTP/#&/g' "$current_cfg"
     sed -i 's/^FallbackNTP/#&/g' "$current_cfg"
 done
+# Create /etc/systemd/timesyncd.d if it doesn't exist
+if [ ! -d "/etc/systemd/timesyncd.d" ]
+then 
+    mkdir /etc/systemd/timesyncd.d
+fi
 # Set primary fallback NTP servers in drop-in configuration
 echo "NTP=$preferred_ntp_servers" >> "$config_file"
 echo "FallbackNTP=$fallback_ntp_servers" >> "$config_file"

# Create /etc/systemd/timesyncd.d if it doesn't exist
if [ ! -d "/etc/systemd/timesyncd.d" ]
then
mkdir etc/systemd/timesyncd.d
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
mkdir etc/systemd/timesyncd.d
mkdir /etc/systemd/timesyncd.d

Copy link
Member

Choose a reason for hiding this comment

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

Please add the full path to the mkdir call.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed, my bad

@Mab879 Mab879 self-assigned this Jan 2, 2024
@Mab879 Mab879 added this to the 0.1.72 milestone Jan 2, 2024
Copy link

codeclimate bot commented Jan 2, 2024

Code Climate has analyzed commit 182a922 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 58.5% (0.0% change).

View more on Code Climate.

@Mab879
Copy link
Member

Mab879 commented Jan 3, 2024

@packbit rebuild-failed

@Mab879
Copy link
Member

Mab879 commented Jan 3, 2024

@packbit retest-failed

@jan-cerny
Copy link
Collaborator

/packit retest-failed

@Mab879 Mab879 merged commit 14815a8 into ComplianceAsCode:master Jan 4, 2024
34 of 36 checks passed
@vojtapolasek vojtapolasek added the Bash Bash remediation update. label Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bash Bash remediation update. needs-ok-to-test Used by openshift-ci bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants