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

Replace hosts file with a memfd #2893

Merged
merged 3 commits into from
Apr 26, 2023

Conversation

stevenengler
Copy link
Contributor

This means that Shadow's fake hosts file isn't written to the filesystem and won't clutter /tmp with hundreds of files.

The temporary hosts file is now cleaned up immediately instead of at the end of
the simulation, which prevents littering the user's /tmp with hosts files when
Shadow crashes.
Now we don't write anything to the filesystem.
@stevenengler stevenengler self-assigned this Apr 26, 2023
@github-actions github-actions bot added the Component: Main Composing the core Shadow executable label Apr 26, 2023
Copy link
Contributor

@sporksmith sporksmith left a comment

Choose a reason for hiding this comment

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

Cool! I wonder if we could do the same with the memory files created by the shmem allocator and the MemoryMapper.

I think at one time we thought it might be useful to have the files around later to inspect when debugging, but I don't think they've been useful in practice.

@stevenengler
Copy link
Contributor Author

stevenengler commented Apr 26, 2023

Cool! I wonder if we could do the same with the memory files created by the shmem allocator and the MemoryMapper.

I think at one time we thought it might be useful to have the files around later to inspect when debugging, but I don't think they've been useful in practice.

I think so, and one benefit would be that we wouldn't run into issues due to a small /dev/shm mount as we do now in Docker containers.

@stevenengler stevenengler merged commit a43150a into shadow:main Apr 26, 2023
22 checks passed
@stevenengler stevenengler deleted the improve-hosts-file branch April 26, 2023 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Main Composing the core Shadow executable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants