diff --git a/xCAT-server/lib/xcat/plugins/windows.pm b/xCAT-server/lib/xcat/plugins/windows.pm index ea3005a05..f03851f3a 100644 --- a/xCAT-server/lib/xcat/plugins/windows.pm +++ b/xCAT-server/lib/xcat/plugins/windows.pm @@ -654,13 +654,18 @@ sub mkinstall # generate the winpe path configuration file for proxydhcp daemon if ($dowinpecfg) { - open (FILE, ">/var/lib/xcat/proxydhcp.cfg"); - print FILE $winpepathcfg; - close (FILE); - - if (open (PDPID, "; - kill 10, $pdpid; + unless (-d "/var/lib/xcat/") { + mkpath "/var/lib/xcat/"; + } + if (open (FILE, ">/var/lib/xcat/proxydhcp.cfg")) { + print FILE $winpepathcfg; + close (FILE); + if (open (PDPID, "; + kill 10, $pdpid; + } + } else { + $callback->({error=>["Cannot open /var/lib/xcat/proxydhcp.cfg for update."],errorcode=>[1]}); } } }