I have a number of servers which I’ve deployed to run openstack a couple months ago, and they started with a 20g /tmp filesystem.
They are all coming up with a full /tmp this week, so I got busy figuring out why.
The script maas-run-scripts which gets put in /usr/bin has a small bug in that it doesn’t remove the stuff it leaves in /tmp when it’s done with it. One way to resolve that put the following code in the script to clean up after itself:
- In the definition of
ScriptsPaths
class - add a class namedcleanup
that looks like this:
def cleanup(self):
if self.base_path.exists():
shutil.rmtree(self.base_path)
- Add an initialization for the self.base_path variable in the init class so it looks like this:
def __init__(self, base_path=None):
if base_path is None:
base_path = Path(mkdtemp())
self.base_path = base_path
self.scripts = base_path / "scripts"
self.out = base_path / "out"
self.downloads = base_path / "downloads"
self.resources_file = base_path / "resources.json"
- And lastly, call the cleanup method at the end of the action_report_results function after the signal handler (line 963)
paths.cleanup()
That should fix the issue at its source, which is a better solution than having a daily cron script clean out /tmp/tmp*
(which is what I’ve implemented)
Thanks
~~ Charles