<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Postscripts_and_Prescripts</title><link>https://sourceforge.net/p/xcat/wiki/Postscripts_and_Prescripts/</link><description>Recent changes to Postscripts_and_Prescripts</description><atom:link href="https://sourceforge.net/p/xcat/wiki/Postscripts_and_Prescripts/feed" rel="self"/><language>en</language><lastBuildDate>Mon, 27 Apr 2015 07:44:10 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/xcat/wiki/Postscripts_and_Prescripts/feed" rel="self" type="application/rss+xml"/><item><title>Postscripts_and_Prescripts modified by Guang Cheng Li</title><link>https://sourceforge.net/p/xcat/wiki/Postscripts_and_Prescripts/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v42
+++ v43
@@ -66,14 +66,14 @@

 The user needs to add a postscript to customize the nics bonding setup, the nics bonding setup will break the network between the management node and compute node, then we could use "at" to run this nic bonding postscripts after all the postscripts processes have been finished.

-We could write a script, say, /install/postscripts/nicbondscript, the nicbondscript simply calls the configuringnicsbond using "at":
-
-~~~~
-[root@xcatmn ~]#cat /install/postscripts/nicscript
+We could write a script, say, /install/postscripts/nicbondscript, the nicbondscript simply calls the confignicsbond using "at":
+
+~~~~
+[root@xcatmn ~]#cat /install/postscripts/nicbondscript

 #!/bin/bash

-at -f ./cms_confignics now + 1 minute
+at -f ./confignicsbond now + 1 minute

 [root@xcatmn ~]#

@@ -82,7 +82,7 @@
 Then 

 ~~~~
-chdef &amp;lt;nodename&amp;gt; -p postbootscripts=nicscrtip
+chdef &amp;lt;nodename&amp;gt; -p postbootscripts=nicbondscript
 ~~~~

 #### Recommended Postscript design
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Guang Cheng Li</dc:creator><pubDate>Mon, 27 Apr 2015 07:44:10 -0000</pubDate><guid>https://sourceforge.net54c7bba37cc56337b166b694e17d2a76405b213e</guid></item><item><title>Postscripts_and_Prescripts modified by Guang Cheng Li</title><link>https://sourceforge.net/p/xcat/wiki/Postscripts_and_Prescripts/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v41
+++ v42
@@ -62,6 +62,29 @@
     updatenode node1 -P
 ~~~~

+If some of your postscripts will affect the network communication between the management node and compute node, like restarting network or configuring bond, the postscripts execution might not be able to be finished successfully because of the network connection problems, even if we put this postscript be the last postscript in the list, xCAT still may not be able to update the node status to be "booted". The recommendation is to use the Linux "at" mechanism to schedule this network-killing postscript to be run at a later time. Here is an example:
+
+The user needs to add a postscript to customize the nics bonding setup, the nics bonding setup will break the network between the management node and compute node, then we could use "at" to run this nic bonding postscripts after all the postscripts processes have been finished.
+
+We could write a script, say, /install/postscripts/nicbondscript, the nicbondscript simply calls the configuringnicsbond using "at":
+
+~~~~
+[root@xcatmn ~]#cat /install/postscripts/nicscript
+
+#!/bin/bash
+
+at -f ./cms_confignics now + 1 minute
+
+[root@xcatmn ~]#
+
+~~~~
+
+Then 
+
+~~~~
+chdef &amp;lt;nodename&amp;gt; -p postbootscripts=nicscrtip
+~~~~
+  
 #### Recommended Postscript design

   * Postscripts that you want to run anywhere, AIX, Linux, should be written in shell. This should be available on all OS's. If only on AIX, they can be written in Perl. If only on the service nodes, you can use Perl whether AIX or Linux. 
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Guang Cheng Li</dc:creator><pubDate>Mon, 27 Apr 2015 07:43:14 -0000</pubDate><guid>https://sourceforge.netd217569d724851553e131e24dd0b9dcaa38e2568</guid></item><item><title>Postscripts_and_Prescripts modified by Guang Cheng Li</title><link>https://sourceforge.net/p/xcat/wiki/Postscripts_and_Prescripts/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v40
+++ v41
@@ -50,6 +50,17 @@
 ~~~~

 p1 p2 are the parameters to script1. 
+
+Starting from xCAT 2.9, the postscripts could be placed in the subdirectories in /install/postscripts on management node, and specify "subdir/postscriptname" in the postscripts table to run the postscripts in the subdirectories. This feature could be used to categorize the postscripts for different purposes. Here is an example:
+
+~~~~
+    mkdir -p /install/postscripts/subdir1
+    mkdir -p /install/postscripts/subdir2
+    cp postscript1 /install/postscripts/subdir1/
+    cp postscript2 /install/postscripts/subdir2/
+    chdef node1 -p postscripts=subdir1/postscript1,subdir2/postscript2
+    updatenode node1 -P
+~~~~

 #### Recommended Postscript design

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Guang Cheng Li</dc:creator><pubDate>Tue, 11 Nov 2014 08:18:40 -0000</pubDate><guid>https://sourceforge.netcf2d9fb9a2436a1869d3133813ef7447d23f2cdc</guid></item><item><title>Postscripts_and_Prescripts modified by Lissa Valletta</title><link>https://sourceforge.net/p/xcat/wiki/Postscripts_and_Prescripts/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v39
+++ v40
@@ -79,7 +79,7 @@
     logfile="/var/log/xcat/xcat.log"
     if [_-f_$1_]; then
      echo "Running postscript: $@" | tee -a $logfile
-     ./$@ 2&amp;gt;&amp;amp;1 | tee -a $logfile
+     ./$@ 2&amp;gt;&amp;amp;1 | tee -a $logfile
     else
      echo "Postscript $1 does NOT exist." | tee -a $logfile
     fi
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Lissa Valletta</dc:creator><pubDate>Mon, 29 Sep 2014 11:29:42 -0000</pubDate><guid>https://sourceforge.net4a4dba24c1d7fe9b6bcfab8894c4e1144e03f2cc</guid></item><item><title>Postscripts_and_Prescripts modified by Lissa Valletta</title><link>https://sourceforge.net/p/xcat/wiki/Postscripts_and_Prescripts/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v38
+++ v39
@@ -288,7 +288,7 @@

 ## Using Hierarchical Clusters

-If you are running a hierarchical cluster, one with Service Nodee. If your /install/postscripts directory is not mounted on the Service Node. You are going to need to sync or copy the postscripts that you added or changed in the /install/postscripts on the MN to the SN, before running them on the compute nodes. To do this easily, use the xdcp command and just copy the entire /install/postscripts directory to the servicenodes ( usually in /xcatpost ). 
+If you are running a hierarchical cluster, one with Service Nodes. If your /install/postscripts directory is not mounted on the Service Node. You are going to need to sync or copy the postscripts that you added or changed in the /install/postscripts on the MN to the SN, before running them on the compute nodes. To do this easily, use the xdcp command and just copy the entire /install/postscripts directory to the servicenodes ( usually in /xcatpost ). 

 ~~~~   
      xdcp service -R /install/postscripts/* /xcatpost
@@ -301,7 +301,7 @@
 ~~~~    

-If your /install/postscrits is not mounted on the Service Node, you should also: 
+If your /install/postscripts is not mounted on the Service Node, you should also: 

 ~~~~  
      xdcp service -R /install/postscripts/* /install
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Lissa Valletta</dc:creator><pubDate>Tue, 09 Sep 2014 18:22:35 -0000</pubDate><guid>https://sourceforge.net6c7ecb7b833e02d0064ace80391e0e71cb276206</guid></item><item><title>Postscripts_and_Prescripts modified by Lissa Valletta</title><link>https://sourceforge.net/p/xcat/wiki/Postscripts_and_Prescripts/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v37
+++ v38
@@ -38,14 +38,15 @@

 ~~~~      
     lsdef node1 | grep scripts
-    postbootscripts=otherpkgs
-~~~~      postscripts=syslog,remoteshell,syncfiles
+    postbootscripts=otherpkgs 
+    postscripts=syslog,remoteshell,syncfiles
+~~~~

 You can pass parameters to the postscripts. For example: 

 ~~~~  
-script1 p1 p2,script2,....
+  script1 p1 p2,script2,....
 ~~~~  

 p1 p2 are the parameters to script1. 
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Lissa Valletta</dc:creator><pubDate>Tue, 09 Sep 2014 18:21:55 -0000</pubDate><guid>https://sourceforge.net9ff51cd72d52473713ac27f9fc7da1bb4b792306</guid></item><item><title>Postscripts_and_Prescripts modified by Lissa Valletta</title><link>https://sourceforge.net/p/xcat/wiki/Postscripts_and_Prescripts/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v36
+++ v37
@@ -237,13 +237,13 @@

 where: 

-\- action1 and action2 are the nodeset actions ( 'install', 'netboot',etc) specified in the command for Linux. 
-
-\- action1 and action2_ can be 'diskless' for mkdsklsnode command, 'standalone' for nimnodeset command, or 'remove' for rmdsklsnoe command for AIX. 
-
-\- s1 and s2 are the scripts to run for _action1_ in order. 
-
-\- s3, s4, and s5 are the scripts to run for action2. 
+- action1 and action2 are the nodeset actions ( 'install', 'netboot',etc) specified in the command for Linux. 
+
+- action1 and action2_ can be 'diskless' for mkdsklsnode command, 'standalone' for nimnodeset command, or 'remove' for rmdsklsnoe command for AIX. 
+
+- s1 and s2 are the scripts to run for _action1_ in order. 
+
+- s3, s4, and s5 are the scripts to run for action2. 

 ~~~~

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Lissa Valletta</dc:creator><pubDate>Tue, 02 Sep 2014 17:50:58 -0000</pubDate><guid>https://sourceforge.net867bf5996d68ce6eee90791deccec157cef7f17d</guid></item><item><title>Postscripts_and_Prescripts modified by Lissa Valletta</title><link>https://sourceforge.net/p/xcat/wiki/Postscripts_and_Prescripts/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v35
+++ v36
@@ -1,4 +1,4 @@
-[[img src=Official-xcat-doc.png]] 
+![](https://sourceforge.net/p/xcat/wiki/XCAT_Documentation/attachment/Official-xcat-doc.png)

 [TOC]

@@ -11,11 +11,12 @@

 ### Types of Post*scripts

-There are two types of *scripts in the postscripts table. The types are based on when in the install process they will be executed. Run the following for more information: 
+There are two types of *scripts in the postscripts table ( postscripts and postbootscripts).  The types are based on when in the install process they will be executed. Run the following for more information: 
+ 
+~~~~   
+    man postscripts

-    tabdump -d postscripts
-    
-
+~~~~  

@@ -34,15 +35,18 @@
 To add your own *script, place it in /install/postscripts on the management node. Make sure it is executable and world readable. Then add it to the postscripts table for the group of nodes you want it to be run on (or the "all" group if you want it run on all nodes in the appropriate attribute, according to when you want it to run. 

 To check what scripts will be run on your node during installation: 
-    
+
+~~~~      
     lsdef node1 | grep scripts
     postbootscripts=otherpkgs
-    postscripts=syslog,remoteshell,syncfiles
+~~~~      postscripts=syslog,remoteshell,syncfiles

 You can pass parameters to the postscripts. For example: 

-_script1 p1 p2,script2,...._
+~~~~  
+script1 p1 p2,script2,....
+~~~~  

 p1 p2 are the parameters to script1. 

@@ -64,8 +68,9 @@
 All attributes in the site table are exported and available to the post*script during execution. See the mypostscript file, which is generated and executed on the nodes to run the postscripts. 

-Example of mypostscript (prior to xCAt 2.8) 
-    
+Example of mypostscript (prior to xCat 2.8) 
+ 
+~~~~     
     #subroutine used to run postscripts
     run_ps () {
     logdir="/var/log/xcat"
@@ -186,7 +191,7 @@
     run_ps script1 p1 p2
     run_ps script2
     # postscripts-end-here\n
-    
+~~~~      

 As of xCAT 2.8, the mypostscript file is generated according to the mypostscript.tmpl file. 

@@ -196,24 +201,29 @@

 ## Prescripts

-The prescript table will allow you to run scripts before the install process. This can be helpful for performing advanced actions such as manipulating system services or configurations before beginning to install a node, or to prepare application servers for the addition of new nodes. 
+The prescript table will allow you to run scripts before the install process. This can be helpful for performing advanced actions such as manipulating system services or configurations before beginning to install a node, or to prepare application servers for the addition of new nodes. Check the man page for more information. 
+
+~~~~  
+  man prescripts
+~~~~

 The scripts will be run as root on the MASTER for the node. If there is a service node for the node, then the scripts will be run on the service node. 

 Identify the scripts to be run for each node by adding entries to the prescripts table: 
-    
+  
+~~~~    
     tabedit prescripts
     Or:
-    chdef -t node -o &amp;lt;noderange&amp;gt; prescripts-begin=&amp;lt;beginscripts&amp;gt; prescripts-end=&amp;lt;endscripts&amp;gt;
+    chdef -t node -o &amp;lt;noderange&amp;gt; prescripts-begin=&amp;lt;beginscripts&amp;gt; prescripts-end=&amp;lt;endscripts&amp;gt;
     Or:
-    chdef -t group -o &amp;lt;nodegroup&amp;gt; prescripts-begin=&amp;lt;beginscripts&amp;gt; prescripts-end=&amp;lt;endscripts&amp;gt;
+    chdef -t group -o &amp;lt;nodegroup&amp;gt; prescripts-begin=&amp;lt;beginscripts&amp;gt; prescripts-end=&amp;lt;endscripts&amp;gt;

-    
+  
     tabdump prescripts
     #node,begin,end,comments,disable
-    
+~~~~      

   * begin or prescripts-begin - This attribute lists the scripts to be run at the beginning of the nodeset(Linux), nimnodeset(AIX), mkdsklsnode(AIX), or rmdsklsnode(AIX) command. 
   * end or prescripts-end - This attribute lists the scripts to be run at the end of the nodeset(Linux), nimnodeset(AIX), mkdsklsnode(AIX), or rmdksklsnode(AIX) command. 
@@ -222,17 +232,20 @@

 The general format for the prescripts-begin or prescripts-end attribute is: 

-[_action1_:]_s1,s2_...[|_action2_:_s3,s4,s5_...] 
+~~~~
+[action1:]s1,s2...[|action2:s3,s4,s5...] 

 where: 

-\- _action1_ and _action2_ are the nodeset actions ( 'install', 'netboot',etc) specified in the command for Linux. 
-
-\- _action1_ and _action2_ can be 'diskless' for mkdsklsnode command, 'standalone' for nimnodeset command, or 'remove' for rmdsklsnode command for AIX. 
-
-\- _s1_ and _s2_ are the scripts to run for _action1_ in order. 
-
-\- _s3_, _s4_, and _s5_ are the scripts to run for _action2_. 
+\- action1 and action2 are the nodeset actions ( 'install', 'netboot',etc) specified in the command for Linux. 
+
+\- action1 and action2_ can be 'diskless' for mkdsklsnode command, 'standalone' for nimnodeset command, or 'remove' for rmdsklsnoe command for AIX. 
+
+\- s1 and s2 are the scripts to run for _action1_ in order. 
+
+\- s3, s4, and s5 are the scripts to run for action2. 
+
+~~~~

 If actions are omitted, the scripts apply to all actions. 

@@ -275,22 +288,26 @@
 ## Using Hierarchical Clusters

 If you are running a hierarchical cluster, one with Service Nodee. If your /install/postscripts directory is not mounted on the Service Node. You are going to need to sync or copy the postscripts that you added or changed in the /install/postscripts on the MN to the SN, before running them on the compute nodes. To do this easily, use the xdcp command and just copy the entire /install/postscripts directory to the servicenodes ( usually in /xcatpost ). 
+ 
+~~~~   
+     xdcp service -R /install/postscripts/* /xcatpost
+~~~~    
+
+or 
+  
+~~~~  
+     prsync /install/postscripts service:/xcatpost
+~~~~    

-     xdcp service -R /install/postscripts/* /xcatpost
-    
+
+If your /install/postscrits is not mounted on the Service Node, you should also: 
+  
+~~~~  
+     xdcp service -R /install/postscripts/* /install
+~~~~    

 or 
-    
-     prsync /install/postscripts service:/xcatpost
-    
-    
-
-If your /install/postscrits is not mounted on the Service Node, you should also: 
-    
-     xdcp service -R /install/postscripts/* /install
-    
-
-or 
-    
+ 
+~~~~   
      prsync /install/postscripts service:/install
-    
+~~~~    
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Lissa Valletta</dc:creator><pubDate>Tue, 29 Jul 2014 12:31:58 -0000</pubDate><guid>https://sourceforge.net4910c460d66c0b0a7bcad863f8b7a93be4daf0e8</guid></item><item><title>Postscripts_and_Prescripts modified by Lissa Valletta</title><link>https://sourceforge.net/p/xcat/wiki/Postscripts_and_Prescripts/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v34
+++ v35
@@ -190,6 +190,8 @@

 As of xCAT 2.8, the mypostscript file is generated according to the mypostscript.tmpl file. 

+### Using the mypostscript template
+
 [[include ref=Template_of_mypostscript]] 

 ## Prescripts
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Lissa Valletta</dc:creator><pubDate>Tue, 22 Jul 2014 16:32:44 -0000</pubDate><guid>https://sourceforge.net0e7f04fd2edc9975f7ddfdf56c99a5c7f7994453</guid></item><item><title>Postscripts_and_Prescripts modified by Lissa Valletta</title><link>https://sourceforge.net/p/xcat/wiki/Postscripts_and_Prescripts/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v33
+++ v34
@@ -190,7 +190,7 @@

 As of xCAT 2.8, the mypostscript file is generated according to the mypostscript.tmpl file. 

-{{:Template_of_mypostscript}} 
+[[include ref=Template_of_mypostscript]] 

 ## Prescripts

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Lissa Valletta</dc:creator><pubDate>Tue, 22 Jul 2014 16:31:15 -0000</pubDate><guid>https://sourceforge.net8d7f27b6e753935188dfdff3d416090a3882d7e0</guid></item></channel></rss>