{"id":363,"date":"2011-04-15T15:37:28","date_gmt":"2011-04-15T21:37:28","guid":{"rendered":"http:\/\/benincosa.com\/blog\/?p=363"},"modified":"2014-11-19T11:25:16","modified_gmt":"2014-11-19T17:25:16","slug":"debugging-syncfiles-in-xcat","status":"publish","type":"post","link":"https:\/\/benincosa.com\/?p=363","title":{"rendered":"Debugging Syncfiles in xCAT"},"content":{"rendered":"<div id=\"_mcePaste\">#!\/usr\/bin\/awk -f<\/div>\n<div id=\"_mcePaste\">BEGIN {<\/div>\n<div id=\"_mcePaste\"># \u00a0if (ENVIRON[&#8220;USEOPENSSLFORXCAT&#8221;]) {<\/div>\n<div id=\"_mcePaste\"># \u00a0 \u00a0 \u00a0server = &#8220;openssl s_client -quiet -connect &#8221; ENVIRON[&#8220;XCATSERVER&#8221;] &#8221; 2&gt; \/dev\/null&#8221;<\/div>\n<div id=\"_mcePaste\"># \u00a0} else {<\/div>\n<div id=\"_mcePaste\"># \u00a0 \u00a0 \u00a0server = &#8220;\/inet\/tcp\/0\/127.0.0.1\/400&#8221;<\/div>\n<div id=\"_mcePaste\"># \u00a0}<\/div>\n<div id=\"_mcePaste\">server = &#8220;openssl s_client -quiet -connect 172.18.58.90:3001 &#8220;<\/div>\n<div id=\"_mcePaste\">quit = &#8220;no&#8221;<\/div>\n<div id=\"_mcePaste\">exitcode = 1<\/div>\n<div id=\"_mcePaste\">print &#8220;&lt;xcatrequest&gt;&#8221; |&amp; server<\/div>\n<div id=\"_mcePaste\">print &#8221; \u00a0 &lt;command&gt;syncfiles&lt;\/command&gt;&#8221; |&amp; server<\/div>\n<div id=\"_mcePaste\">print &#8220;&lt;\/xcatrequest&gt;&#8221; |&amp; server<\/div>\n<div id=\"_mcePaste\">while (server |&amp; getline) {<\/div>\n<div id=\"_mcePaste\">if (match($0,&#8221;&lt;serverdone&gt;&#8221;)) {<\/div>\n<div id=\"_mcePaste\">quit = &#8220;yes&#8221;<\/div>\n<div id=\"_mcePaste\">}<\/div>\n<div id=\"_mcePaste\">if (match($0,&#8221;&lt;errorcode&gt;&#8221;) || match($0,&#8221;&lt;error&gt;&#8221;)) {<\/div>\n<div id=\"_mcePaste\">exitcode = 0<\/div>\n<div id=\"_mcePaste\">}<\/div>\n<div id=\"_mcePaste\">if (match($0,&#8221;&lt;\/xcatresponse&gt;&#8221;) &amp;&amp; match(quit,&#8221;yes&#8221;)) {<\/div>\n<div id=\"_mcePaste\">close(server)<\/div>\n<div id=\"_mcePaste\">exit exitcode<\/div>\n<div id=\"_mcePaste\">}<\/div>\n<div id=\"_mcePaste\">}<\/div>\n<div id=\"_mcePaste\">}<\/div>\n<p>#!\/usr\/bin\/awk -fBEGIN {# \u00a0if (ENVIRON[&#8220;USEOPENSSLFORXCAT&#8221;]) {# \u00a0 \u00a0 \u00a0server = &#8220;openssl s_client -quiet -connect &#8221; ENVIRON[&#8220;XCATSERVER&#8221;] &#8221; 2&gt; \/dev\/null&#8221;# \u00a0} else {# \u00a0 \u00a0 \u00a0server = &#8220;\/inet\/tcp\/0\/127.0.0.1\/400&#8243;# \u00a0}<br \/>\nserver = &#8220;openssl s_client -quiet -connect 172.18.58.90:3001 &#8221;<br \/>\nquit = &#8220;no&#8221;\u00a0 exitcode = 1<br \/>\nprint &#8220;&lt;xcatrequest&gt;&#8221; |&amp; server\u00a0 print &#8221; \u00a0 &lt;command&gt;syncfiles&lt;\/command&gt;&#8221; |&amp; server\u00a0 print &#8220;&lt;\/xcatrequest&gt;&#8221; |&amp; server<br \/>\nwhile (server |&amp; getline) {\u00a0 \u00a0 if (match($0,&#8221;&lt;serverdone&gt;&#8221;)) {\u00a0 \u00a0 \u00a0 quit = &#8220;yes&#8221;\u00a0 \u00a0 }\u00a0 \u00a0 if (match($0,&#8221;&lt;errorcode&gt;&#8221;) || match($0,&#8221;&lt;error&gt;&#8221;)) {\u00a0 \u00a0 \u00a0 exitcode = 0\u00a0 \u00a0 }<br \/>\nif (match($0,&#8221;&lt;\/xcatresponse&gt;&#8221;) &amp;&amp; match(quit,&#8221;yes&#8221;)) {\u00a0 \u00a0 \u00a0 close(server)\u00a0 \u00a0 \u00a0 exit exitcode\u00a0 \u00a0 }\u00a0 }}I&#8217;ve had issues lately where syncfiles hangs on post install forever. \u00a0In fact it even kills the installer. \u00a0To fix it, I usually just do:<\/p>\n<p>nodeset &lt;node&gt; boot<\/p>\n<p>Then run:<\/p>\n<p>rpower &lt;node&gt; boot<\/p>\n<p>Next, you log into the node when it boots and create this little script (borrowed from \/xcatpost\/startsyncfiles.awk)<\/p>\n<pre>#!\/usr\/bin\/awk -f\r\nBEGIN {\r\n#  if (ENVIRON[\"USEOPENSSLFORXCAT\"]) {\r\n#      server = \"openssl s_client -quiet -connect \" ENVIRON[\"XCATSERVER\"] \" 2&gt; \/dev\/null\"\r\n#  } else {\r\n#      server = \"\/inet\/tcp\/0\/127.0.0.1\/400\"\r\n#  }\r\n\r\n  server = \"openssl s_client -quiet -connect 10.0.0.1:3001 \"\r\n\r\n  quit = \"no\"\r\n  exitcode = 1\r\n\r\n  print \"&lt;xcatrequest&gt;\" |&amp; server\r\n  print \"   &lt;command&gt;syncfiles&lt;\/command&gt;\" |&amp; server\r\n  print \"&lt;\/xcatrequest&gt;\" |&amp; server\r\n\r\n  while (server |&amp; getline) {\r\n    if (match($0,\"&lt;serverdone&gt;\")) {\r\n      quit = \"yes\"\r\n    }\r\n    if (match($0,\"&lt;errorcode&gt;\") || match($0,\"&lt;error&gt;\")) {\r\n      exitcode = 0\r\n    }\r\n\r\n    if (match($0,\"&lt;\/xcatresponse&gt;\") &amp;&amp; match(quit,\"yes\")) {\r\n      close(server)\r\n      exit exitcode\r\n    }\r\n  }\r\n}<\/pre>\n<p>Then you just run that code and it will start syncfiles the way the postscript does. \u00a0The thing to watch for here is that 10.0.0.1 IP address I put in. \u00a0You&#8217;ll have to put your management server&#8217;s IP address there. \u00a0You can also sub other commands instead of syncfiles here as well. \u00a0Like xcatlog etc.<\/p>\n<p>One issue I noticed while doing this is that even though updatenode -F worked, and if I installed the node with rinstall &lt;node&gt; -o rhels5.5 -a x86_64 -p foo then it would get the correct syncfiles. \u00a0However, if I put that image foo inside the osimage table and ran the install, it wouldn&#8217;t get the syncfile right unless I added the syncfile to the osimage table.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>#!\/usr\/bin\/awk -f BEGIN { # \u00a0if (ENVIRON[&#8220;USEOPENSSLFORXCAT&#8221;]) { # \u00a0 \u00a0 \u00a0server = &#8220;openssl s_client -quiet -connect &#8221; ENVIRON[&#8220;XCATSERVER&#8221;] &#8221; 2&gt; \/dev\/null&#8221; # \u00a0} else { # \u00a0 \u00a0 \u00a0server = &#8220;\/inet\/tcp\/0\/127.0.0.1\/400&#8221; # \u00a0} server = &#8220;openssl s_client -quiet -connect 172.18.58.90:3001 &#8220; quit = &#8220;no&#8221; exitcode = 1 print &#8220;&lt;xcatrequest&gt;&#8221; |&amp; server print &#8221; \u00a0&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[916],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/posts\/363"}],"collection":[{"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/benincosa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=363"}],"version-history":[{"count":4,"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/posts\/363\/revisions"}],"predecessor-version":[{"id":2795,"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/posts\/363\/revisions\/2795"}],"wp:attachment":[{"href":"https:\/\/benincosa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=363"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/benincosa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=363"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/benincosa.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}