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

Cleanup temporary files #35

Open
ezrizhu opened this issue Jun 21, 2023 · 2 comments
Open

Cleanup temporary files #35

ezrizhu opened this issue Jun 21, 2023 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@ezrizhu
Copy link
Collaborator

ezrizhu commented Jun 21, 2023

Do we want to cleanup the tempdir and tempfiles that we make?

@mgree
Copy link
Contributor

mgree commented Jun 24, 2023

If they're in /tmp we shouldn't need to care about it.

I can imagine having some kind of trap 'cleanup' EXIT that would remove files if things borked before we ran the command. But once it's run, we shouldn't delete anything.

Longer term, we'd like to be able to store and name try results by some SHA-like code, which means keeping them somewhere more durable.

@mgree mgree changed the title cleanup Cleanup temporary files Jun 24, 2023
@mgree mgree added enhancement New feature or request good first issue Good for newcomers labels Jun 24, 2023
@mgree
Copy link
Contributor

mgree commented Jun 24, 2023

A good first issue:

  • Identify the temporary files we've created (the two shell scripts, tmp directory) and store them in a CLEANUP variable
  • Set a trap to remove them if, e.g., the calls to unshare or mount fail
  • After the command runs, disable the trap, leave the directory, and delete the shell scripts

This was referenced Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants