From 93f5b9f6cb9cf7ddda7bea3b3b4417ea3aa0f323 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Mon, 10 Sep 2012 18:58:03 +0000 Subject: [PATCH] Make extra effort to assure /mnt/xcat is not held in event of catastrophe git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@13746 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/copycds.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/copycds.pm b/xCAT-server/lib/xcat/plugins/copycds.pm index b43309648..eceedb137 100644 --- a/xCAT-server/lib/xcat/plugins/copycds.pm +++ b/xCAT-server/lib/xcat/plugins/copycds.pm @@ -100,9 +100,11 @@ sub process_request { mkdir "/mnt/xcat"; if (system("mount $mntopts '$file' /mnt/xcat")) { - $callback->({error=>"copycds was unable to mount $file to /mnt/xcat.",errorcode=>[1]}); + eval { $callback->({error=>"copycds was unable to mount $file to /mnt/xcat.",errorcode=>[1]}) }; + system("umount -l /mnt/xcat")) { return; } + eval { my $newreq = dclone($request); $newreq->{command}= [ 'copycd' ]; #Note the singular, it's different $newreq->{arg} = ["-m","/mnt/xcat"]; @@ -143,6 +145,7 @@ sub process_request { chdir($existdir); while (wait() > 0) { yield(); } #Make sure all children exit before trying umount + }; system("umount -l /mnt/xcat"); unless ($identified) { $callback->({error=>["copycds could not identify the ISO supplied, you may wish to try -n "],errorcode=>[1]});