diff --git a/docs/source/guides/admin-guides/references/man5/site.5.rst b/docs/source/guides/admin-guides/references/man5/site.5.rst index 0496a919e..5da893f95 100644 --- a/docs/source/guides/admin-guides/references/man5/site.5.rst +++ b/docs/source/guides/admin-guides/references/man5/site.5.rst @@ -288,7 +288,9 @@ site Attributes: cleanupdiskfullxcatpost: (yes/1 or no/0). Set to 'yes' or '1' to clean up the /xcatpost directory on the diskfull nodes after the - postscripts are run with no errors. Default is no. + postscripts are run with no errors: at deployment, after each + updatenode run, and after a reboot. updateflag.awk stays, so + the node can still report its status. Default is no. db2installloc: The location which the service nodes should mount for the db2 code to install. Format is hostname:/path. If hostname is diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index 4fdafac6b..d3618bef1 100644 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -1198,7 +1198,9 @@ passed as argument rather than by table value', " postscripts are run. Default is no.\n\n" . " cleanupdiskfullxcatpost: (yes/1 or no/0). Set to 'yes' or '1' to clean up the /xcatpost\n" . " directory on the diskfull nodes after the\n" . -" postscripts are run with no errors. Default is no.\n\n" . +" postscripts are run with no errors: at deployment, after each\n" . +" updatenode run, and after a reboot. updateflag.awk stays, so\n" . +" the node can still report its status. Default is no.\n\n" . " db2installloc: The location which the service nodes should mount for\n" . " the db2 code to install. Format is hostname:/path. If hostname is\n" . " omitted, it defaults to the management node. Default is /mntdb2.\n\n" . diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index 5b8774f79..f8272561d 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -230,6 +230,12 @@ parsehttpserver () # The append happens on every path this script serves: node deployment, and each # updatenode, moncfg or reboot run. # +# The two site attributes do not ask for the same thing. cleanupxcatpost removes +# every file and ignores the result of the run. cleanupdiskfullxcatpost keeps +# updateflag.awk, which the node needs to report its status, and removes nothing +# after a failed run, so the postscripts stay on the node for diagnosis. +# xcatinstallpost applies the same rule at install time. +# # $1 - path of the generated mypostscript # $2 - the xcatpost directory to remove the postscripts from ##################################################### @@ -238,6 +244,7 @@ append_xcatpost_cleanup() local mypostscript=$1 local postdir=$2 local cleanupxcatpost + local cleanupdiskfullxcatpost cleanupxcatpost=`grep CLEANUPXCATPOST= "$mypostscript" |awk -F = '{print $2}' | tr -d \'\" | tr A-Z a-z` if [[ "$cleanupxcatpost" =~ ^(1|yes|y)$ ]]; then @@ -245,6 +252,18 @@ append_xcatpost_cleanup() # /xcatpost might be read-only for statelite nodes echo "rm -rf $postdir/*" >> "$mypostscript" fi + + cleanupdiskfullxcatpost=`grep CLEANUPDISKFULLXCATPOST= "$mypostscript" |awk -F = '{print $2}' | tr -d \'\" | tr A-Z a-z` + if [[ "$cleanupdiskfullxcatpost" =~ ^(1|yes|y)$ ]]; then + cat >> "$mypostscript" <