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

feat: run initializations before starting main process #2516

Merged
merged 2 commits into from
Dec 14, 2023

Conversation

reubenmiller
Copy link
Contributor

@reubenmiller reubenmiller commented Dec 12, 2023

Proposed changes

Run tedge init using root user to setup the service before starting the main process. This allows folders to be created on startup rather than during installation time (see linked ticket for further details).

Notes

  • + is only used on services where the main process is run under a non-root user, e.g. tedge - see systemd.service docs
  • - is used when running the tedge init so that any initialization failure does not block attempting to start the main process (to avoid errors in non critical actions run in tedge init from blocking the starting of the main process)
  • support for systemd versions < 231 is dropped with this PR, though the linux distributions that use systemd < 231 are either EOL or about to be EOL (within 6 months)

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (general improvements like code refactoring that doesn't explicitly fix a bug or add any new functionality)
  • Documentation Update (if none of the other choices apply)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Paste Link to the issue

#2448

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA (in all commits with git commit -s)
  • I ran cargo fmt as mentioned in CODING_GUIDELINES
  • I used cargo clippy as mentioned in CODING_GUIDELINES
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

@reubenmiller reubenmiller changed the title Issue-2448 feat: run initializations before starting main process Dec 12, 2023
@reubenmiller reubenmiller added theme:packaging Theme: Packaging and release artefact topics theme:monitoring Theme: Service monitoring and watchdogs labels Dec 12, 2023
Copy link
Contributor

github-actions bot commented Dec 12, 2023

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
367 0 3 367 100 54m43.494999999s

The initialization is run as root to enable creating the required folders. The init command is also allowed to failed so that it does not block the attempt to start the underlying process

Signed-off-by: Reuben Miller <reuben.d.miller@gmail.com>
The service will now recreate the required folders on startup

Signed-off-by: Reuben Miller <reuben.d.miller@gmail.com>
@reubenmiller reubenmiller merged commit e0a6927 into thin-edge:main Dec 14, 2023
16 checks passed
@reubenmiller reubenmiller deleted the issue-2448 branch December 14, 2023 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme:monitoring Theme: Service monitoring and watchdogs theme:packaging Theme: Packaging and release artefact topics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants