From 59ab923725d37675b415bcbf50589330335a4868 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Thu, 15 May 2008 15:48:34 +0000 Subject: [PATCH] -Have copycds umount on interrupt, SF bug 1962643 git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1409 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server-2.0/lib/xcat/plugins/anaconda.pm | 3 +++ xCAT-server-2.0/lib/xcat/plugins/copycds.pm | 2 ++ xCAT-server-2.0/lib/xcat/plugins/sles.pm | 6 +++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/xCAT-server-2.0/lib/xcat/plugins/anaconda.pm b/xCAT-server-2.0/lib/xcat/plugins/anaconda.pm index 9b0cc65d6..153f94c6f 100644 --- a/xCAT-server-2.0/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server-2.0/lib/xcat/plugins/anaconda.pm @@ -771,6 +771,9 @@ sub copycd my $reaped = 0; $SIG{INT} = $SIG{TERM} = sub { if ($cpiopid) { kill 2, $cpiopid; exit 0; } + if ($::CDMOUNTPATH) { + system("umount $::CDMOUNTPATH"); + } }; my $KID; chdir $path; diff --git a/xCAT-server-2.0/lib/xcat/plugins/copycds.pm b/xCAT-server-2.0/lib/xcat/plugins/copycds.pm index ad9eb0bb2..d671af787 100644 --- a/xCAT-server-2.0/lib/xcat/plugins/copycds.pm +++ b/xCAT-server-2.0/lib/xcat/plugins/copycds.pm @@ -32,6 +32,7 @@ sub process_request { my $distname = undef; my $arch = undef; $identified=0; + $::CDMOUNTPATH="/mnt/xcat"; @ARGV = @{$request->{arg}}; GetOptions( @@ -69,6 +70,7 @@ sub process_request { push @{$newreq->{arg}},("-a",$arch); } $doreq->($newreq,\&take_answer); + $::CDMOUNTPATH=""; system("umount /mnt/xcat"); unless ($identified) { diff --git a/xCAT-server-2.0/lib/xcat/plugins/sles.pm b/xCAT-server-2.0/lib/xcat/plugins/sles.pm index b8a00afcf..316b1ace2 100644 --- a/xCAT-server-2.0/lib/xcat/plugins/sles.pm +++ b/xCAT-server-2.0/lib/xcat/plugins/sles.pm @@ -412,7 +412,11 @@ sub copycd mkpath("$installroot/$distname/$arch/$discnumber"); umask $omask; my $rc; - $SIG{INT} = $SIG{TERM} = sub { if ($cpiopid) { kill 2, $cpiopid; exit 0; } }; + $SIG{INT} = $SIG{TERM} = sub { if ($cpiopid) { kill 2, $cpiopid; exit 0; } + if ($::CDMOUNTPATH) { + system("umount $::CDMOUNTPATH"); + } + }; my $kid; chdir $path; my $child = open($kid,"|-");