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

Create empty k3s service file #495

Merged
merged 1 commit into from
Nov 17, 2023
Merged

Conversation

Itxaka
Copy link
Member

@Itxaka Itxaka commented Nov 17, 2023

Somehow on systemd 245 (245.4-4ubuntu3.22) becuase the k3s file was created with no content, it marked it as a masked service and nothing would work as expected.

Creating the file with empty service and execstart makes the service not appear as masked and allows the override to work as expected

This patch also adds more logging to the log file, and writing the service file before starting it.

root@qcs6490-odk:~# systemctl status k3s
Warning: The unit file, source configuration file or drop-ins of k3s.service changed on disk. Run 'systemctl daemon-reload' to reload units.
● k3s.service
     Loaded: masked (Reason: Unit k3s.service is masked.)
    Drop-In: /etc/systemd/system/k3s.service.d
             └─override.conf
     Active: inactive (dead)

Somehow on systemd 245 (245.4-4ubuntu3.22) becuase the k3s file was
created with no content, it marked it as a masked service and nothing
would work as expected.

Creating the file with empty service and execstart makes the service not
appear as masked and allows the override to work as expected

This patch also adds more logging to the log file, and writing the
service file before starting it.

```
root@qcs6490-odk:~# systemctl status k3s
Warning: The unit file, source configuration file or drop-ins of k3s.service changed on disk. Run 'systemctl daemon-reload' to reload units.
● k3s.service
     Loaded: masked (Reason: Unit k3s.service is masked.)
    Drop-In: /etc/systemd/system/k3s.service.d
             └─override.conf
     Active: inactive (dead)
```

Signed-off-by: Itxaka <itxaka@kairos.io>
@Itxaka Itxaka requested a review from a team November 17, 2023 15:01
@Itxaka
Copy link
Member Author

Itxaka commented Nov 17, 2023

This would need testing in the main kairos in all flavors to see if it affects something. It should not as we have the override I think, but just in case. Tests would fail pretty good if that is the case.

Copy link

codecov bot commented Nov 17, 2023

Codecov Report

Attention: 23 lines in your changes are missing coverage. Please review.

Comparison is base (5fcd647) 12.27% compared to head (05178ae) 12.05%.

Files Patch % Lines
internal/provider/bootstrap.go 0.00% 23 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #495      +/-   ##
==========================================
- Coverage   12.27%   12.05%   -0.23%     
==========================================
  Files          17       17              
  Lines        1075     1095      +20     
==========================================
  Hits          132      132              
- Misses        916      936      +20     
  Partials       27       27              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@mauromorales mauromorales left a comment

Choose a reason for hiding this comment

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

change lgtm but I didn't test. Great to see more logs there :)

@Itxaka Itxaka merged commit 1b7876c into kairos-io:main Nov 17, 2023
7 of 9 checks passed
@Itxaka Itxaka deleted the fix_empty_service branch November 17, 2023 17:40
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.

2 participants