Technology

Debugging Syncfiles in xCAT

#!/usr/bin/awk -f
BEGIN {
#  if (ENVIRON["USEOPENSSLFORXCAT"]) {
#      server = "openssl s_client -quiet -connect " ENVIRON["XCATSERVER"] " 2> /dev/null"
#  } else {
#      server = "/inet/tcp/0/127.0.0.1/400"
#  }
server = "openssl s_client -quiet -connect 172.18.58.90:3001 "
quit = "no"
exitcode = 1
print "<xcatrequest>" |& server
print "   <command>syncfiles</command>" |& server
print "</xcatrequest>" |& server
while (server |& getline) {
if (match($0,"<serverdone>")) {
quit = "yes"
}
if (match($0,"<errorcode>") || match($0,"<error>")) {
exitcode = 0
}
if (match($0,"</xcatresponse>") && match(quit,"yes")) {
close(server)
exit exitcode
}
}
}
#!/usr/bin/awk -fBEGIN {#  if (ENVIRON["USEOPENSSLFORXCAT"]) {#      server = "openssl s_client -quiet -connect " ENVIRON["XCATSERVER"] " 2> /dev/null"#  } else {#      server = "/inet/tcp/0/127.0.0.1/400"#  } server = "openssl s_client -quiet -connect 172.18.58.90:3001 " quit = "no"  exitcode = 1 print "<xcatrequest>" |& server  print "   <command>syncfiles</command>" |& server  print "</xcatrequest>" |& server while (server |& getline) {    if (match($0,"<serverdone>")) {      quit = "yes"    }    if (match($0,"<errorcode>") || match($0,"<error>")) {      exitcode = 0    } if (match($0,"</xcatresponse>") && match(quit,"yes")) {      close(server)      exit exitcode    }  }}I've had issues lately where syncfiles hangs on post install forever.  In fact it even kills the installer.  To fix it, I usually just do: nodeset <node> boot Then run: rpower <node> boot Next, you log into the node when it boots and create this little script (borrowed from /xcatpost/startsyncfiles.awk)
#!/usr/bin/awk -f
BEGIN {
#  if (ENVIRON["USEOPENSSLFORXCAT"]) {
#      server = "openssl s_client -quiet -connect " ENVIRON["XCATSERVER"] " 2> /dev/null"
#  } else {
#      server = "/inet/tcp/0/127.0.0.1/400"
#  }

  server = "openssl s_client -quiet -connect 10.0.0.1:3001 "

  quit = "no"
  exitcode = 1

  print "<xcatrequest>" |& server
  print "   <command>syncfiles</command>" |& server
  print "</xcatrequest>" |& server

  while (server |& getline) {
    if (match($0,"<serverdone>")) {
      quit = "yes"
    }
    if (match($0,"<errorcode>") || match($0,"<error>")) {
      exitcode = 0
    }

    if (match($0,"</xcatresponse>") && match(quit,"yes")) {
      close(server)
      exit exitcode
    }
  }
}
Then you just run that code and it will start syncfiles the way the postscript does.  The thing to watch for here is that 10.0.0.1 IP address I put in.  You'll have to put your management server's IP address there.  You can also sub other commands instead of syncfiles here as well.  Like xcatlog etc. One issue I noticed while doing this is that even though updatenode -F worked, and if I installed the node with rinstall <node> -o rhels5.5 -a x86_64 -p foo then it would get the correct syncfiles.  However, if I put that image foo inside the osimage table and ran the install, it wouldn't get the syncfile right unless I added the syncfile to the osimage table.