Skip to content

Conversation

@3405691582
Copy link
Collaborator

The acloud_cvd_temp directory contains instance lock files. If we are resetting with cvd reset, we should remove these, since we are resetting state completely anyway.

This will become more important later when we are making changes to the way instance locks are acquired, and starting from a clean slate with cvd reset is more convenient than manually removing lock files.

The acloud_cvd_temp directory contains instance lock files. If we are
resetting with cvd reset, we should remove these, since we are resetting
state completely anyway.

This will become more important later when we are making changes to the
way instance locks are acquired, and starting from a clean slate with
cvd reset is more convenient than manually removing lock files.
/* clear_instance_dirs*/ options.clean_runtime_dir));

if (DirectoryExists("/tmp/acloud_cvd_temp/")) {
CF_EXPECT(RecursivelyRemoveDirectory("/tmp/acloud_cvd_temp/"));
Copy link
Member

Choose a reason for hiding this comment

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

Does it seem worth it to delete the contents of this directory without deleting the directory itself?

I could imagine a user changing the directory permissions of this to facilitate some multi-user interaction, though it would have to be reset on every reboot anyway since /tmp is not going to be persistent. Maybe not that significant in that context.

Copy link
Collaborator Author

@3405691582 3405691582 Aug 4, 2025

Choose a reason for hiding this comment

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

It may not be worth the effort. If we want to support the multi-user case better, then we probably need to improve the directory structure here and maybe put some of these files elsewhere, but that's a larger change.

But I'm happy to make the adjustment if you think it's worthwhile.

Copy link
Member

Choose a reason for hiding this comment

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

Changing the structure has other downsides, it breaks compatibility with python acloud. Might as well delete it then.

CF_EXPECT(KillAllCuttlefishInstances(
/* clear_instance_dirs*/ options.clean_runtime_dir));

if (DirectoryExists("/tmp/acloud_cvd_temp/")) {
Copy link
Member

Choose a reason for hiding this comment

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

As there are already 3 non-test occurrences of this string, maybe worth making a shared constant in a new file somewhere?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That'll be the next pr after this one. ;)

@Databean Databean added the kokoro:run Run e2e tests. label Aug 4, 2025
@GoogleCuttlefishTesterBot GoogleCuttlefishTesterBot removed the kokoro:run Run e2e tests. label Aug 4, 2025
Copy link
Member

@jemoreira jemoreira left a comment

Choose a reason for hiding this comment

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

That directory is shared among all users in the system. cvd reset is supposed to only reset devices for the current user.

A more "correct" way for handling this is to have cvd change the ownership of each file it takes over to the current user. For that to work these files need to be created with rw permission for all. At reset time, cvd will only delete those files that are owned by the current user.

The one problem the approach mentioned above doesn't solve is acloud. It doesn't change ownership of those files, it simply reuses them if they are present. But acloud and cvd create are rarely used in the same machines these days, so it should be ok.

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.

4 participants