projects
/
invirt/packages/invirt-remote.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Prevent the janitor from trying to clean up nonexistent LVs.
[invirt/packages/invirt-remote.git]
/
host
/
usr
/
sbin
/
invirt-janitor
diff --git
a/host/usr/sbin/invirt-janitor
b/host/usr/sbin/invirt-janitor
index
6edcca9
..
4f79c5b
100755
(executable)
--- 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 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
syslog.syslog(syslog.LOG_INFO, "Cleaning up LV '%s'" % lv_path)
# In a perfect world, this should be erroring out with
@@
-55,6
+61,7
@@
def cleanup():
subprocess.call(['/usr/bin/ionice',
'-c', '2',
'-n', '7',
subprocess.call(['/usr/bin/ionice',
'-c', '2',
'-n', '7',
+ '/usr/bin/nice',
'/bin/dd',
'if=/dev/zero',
'of=%s' % lv_path,
'/bin/dd',
'if=/dev/zero',
'of=%s' % lv_path,