canonical / ubuntu-pro-client

Ubuntu Pro Client for offerings from Canonical
https://canonical-ubuntu-pro-client.readthedocs-hosted.com/en/latest/
GNU General Public License v3.0
52 stars 73 forks source link

Bug: Add service to detect clones on boot #3098

Open dheyay opened 5 months ago

dheyay commented 5 months ago

Fixes: #3068

Why is this needed?

This PR solves all of our problems because...

Test Steps

Checklist

Does this PR require extra reviews?

github-actions[bot] commented 5 months ago

Jira: This PR is not related to a Jira item. (The PR title does not include a SC-#### reference)

GitHub Issues:

Launchpad Bugs: No Launchpad bugs are fixed by this PR. (No commits have LP: #### references)

Documentation: The changes in this PR do not require documentation changes.

👍 this comment to confirm that this is correct.

lucasmoura commented 5 months ago

@dheyay @orndorffgrant I wonder if we should instead reuse the ua-reboot-cmds for this. Even though this service requires a marker file to exist in order to run, I think we can create that marker file whenever we attach the machine. In that sense, a clone would also carry that marker file with it.

The downside of this approach is that we will now execute this service on every reboot of an attached machine. We could create another marker file to show that we should only run the metering part of the service, but this might be adding to much complexity to the service.

So let me know if we should further discuss this idea.

orndorffgrant commented 5 months ago

Upon reviewing I had yet another idea: we could store jobs-status.json in /run which would make just the normal timer (with OnStartupSec=1min) execute all jobs once on startup. We can discuss more when we have time (in madrid or after)