mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 17:10:48 +01:00
kill procs before data
This commit is contained in:
parent
9a5638cee6
commit
8e7d38906d
@ -38,15 +38,17 @@ def killprocs( signal="" ):
|
||||
|
||||
def cleanup( root ):
|
||||
|
||||
|
||||
if killprocs() > 0:
|
||||
time.sleep(3)
|
||||
killprocs("-9")
|
||||
|
||||
# delete all regular files, directories can stay
|
||||
# NOTE: if we delete directories later, we can't delete diskfulltest
|
||||
for ( dirpath , dirnames , filenames ) in os.walk( root , topdown=False ):
|
||||
for x in filenames:
|
||||
os.remove( dirpath + "/" + x )
|
||||
|
||||
if killprocs() > 0:
|
||||
time.sleep(3)
|
||||
killprocs("-9")
|
||||
|
||||
if __name__ == "__main__":
|
||||
root = "/data/db/"
|
||||
|
Loading…
Reference in New Issue
Block a user