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

tedge_mapper az/collectd services start running when the thin-edge device restarts #1683

Merged
merged 1 commit into from
Feb 2, 2023

Conversation

PradeepKiruvale
Copy link
Contributor

Proposed changes

Disable the tedge-mapper az/c8y/collectd on installation
Also, start the mappers only if bridge config file exists

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

#1631

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


[Service]
User=tedge
ExecStartPre=/bin/bash -c '/usr/bin/systemctl is-active --quiet collectd.service'
Copy link
Contributor

Choose a reason for hiding this comment

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

It is better to use the Requires field to list the hard dependency to the collectd.service instead of using the ExecStartPre.

Checkout the systemd docs for more info

start = false
enable = false
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we want to enable the starting of the service by default now? As the other services should be prevented from starting due to the ConditionPathExists which will block it from starting if the related mapper files don't exist.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, Removed these.

Copy link
Contributor

@reubenmiller reubenmiller left a comment

Choose a reason for hiding this comment

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

Few minor changes required

Signed-off-by: Pradeep Kumar K J <pradeepkumar.kj@softwareag.com>
Copy link
Member

@rina23q rina23q left a comment

Choose a reason for hiding this comment

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

Looks good, commit messages should be cleaned up before merging though.
Also, better to test the new artifacts before merging especially to check if it doesn't break self-update of tedge_mapper. @gligorisaev has the test case for that already.

@reubenmiller
Copy link
Contributor

Just updating the expected test conditions:

The systemctl service status tedge-mapper-az and tedge-mapper-collectd will retain the the same service state (e.g. either enabled or disabled) as it was prior to the upgrade of thin-edge.io.

For example:

  • If the tedge-mapper-az is already enabled prior to the update, then it will continue being enabled
  • If the tedge-mapper-az is already disabled prior to the update, then it will continue being disabled

@reubenmiller reubenmiller added bug Something isn't working theme:packaging Theme: Packaging and release artefact topics labels Feb 1, 2023
Copy link
Contributor

@reubenmiller reubenmiller left a comment

Choose a reason for hiding this comment

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

Approved. I verified the test case with @gligorisaev and we have the 👍

@PradeepKiruvale PradeepKiruvale merged commit dc9cc74 into thin-edge:main Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working theme:packaging Theme: Packaging and release artefact topics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants