From 6f0f854835da0f1ec07dc498660257006cc4f0e3 Mon Sep 17 00:00:00 2001 From: Mitchell E Berger Date: Tue, 25 Oct 2011 01:33:06 -0400 Subject: [PATCH] Prevent the janitor from trying to clean up nonexistent LVs. If, for some reason or another, an LV doesn't exist, we would previously dd from /dev/zero into a new file in /dev/xenvg, thus filling the devfs. --- debian/changelog | 6 ++++++ host/usr/sbin/invirt-janitor | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/debian/changelog b/debian/changelog index fd40bc4..1ad3152 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +invirt-remote (0.4.11) unstable; urgency=low + + * Don't let the janitor try to cleanup nonexistent LVs + + -- Mitchell Berger Tue, 25 Oct 2011 01:32:00 -0400 + invirt-remote (0.4.10) unstable; urgency=low * Bump version. diff --git a/host/usr/sbin/invirt-janitor b/host/usr/sbin/invirt-janitor index 5d8f4ed..4f79c5b 100755 --- a/host/usr/sbin/invirt-janitor +++ b/host/usr/sbin/invirt-janitor @@ -48,6 +48,12 @@ def cleanup(): if not lv.startswith('old_'): continue + # If the LV doesn't exist, for whatever reason, don't + # proceed because the dd will simply fill the devfs + # by creating a regular file and filling it with zeros. + if not os.path.exists(lv_path): + continue + syslog.syslog(syslog.LOG_INFO, "Cleaning up LV '%s'" % lv_path) # In a perfect world, this should be erroring out with -- 1.7.9.5