fix for bug 4374: support running postscripts under directories in /intall/postscripts/

This commit is contained in:
ligc 2013-11-12 16:42:03 +08:00
parent a049714a3e
commit f0987c908f
4 changed files with 12 additions and 5 deletions

4
xCAT-server/share/xcat/install/scripts/post.ubuntu Normal file → Executable file
View File

@ -63,7 +63,9 @@ do
export XCATSERVER
mv $i/postscripts /xcatpost
rm -rf $i
chmod +x /xcatpost/*
# To support the postscripts in the subdirectories under /install/postscripts
#chmod +x /xcatpost/*
chmod -R +x `find /xcatpost/ -maxdepth 1 -print | grep -E -v '^(/xcatpost/|/xcatpost/_xcat|/xcatpost/_ssh|/xcatpost/ca|/xcatpost/hostkeys)$'`
/xcatpost/getpostscript.awk |sed -e 's/<[^>]*>//g'|egrep -v '^ *$'|sed -e 's/^ *//' | sed -e 's/&lt;/</g' -e 's/&gt;/>/g' -e 's/&amp;/\&/g' -e 's/&quot;/"/g' -e "s/&apos;/'/g" > /xcatpost/mypostscript
MYCONT=`grep MASTER /xcatpost/mypostscript`
MAX_RETRIES=10

View File

@ -43,7 +43,9 @@ do
# If mypostscript doesn't exist, we will get it through getpostscript.awk
if [ ! -x /xcatpost/mypostscript ]; then
chmod +x /xcatpost/*
# To support the postscripts in the subdirectories under /install/postscripts
# chmod +x /xcatpost/*
chmod -R +x `find /xcatpost/ -maxdepth 1 -print | grep -E -v '^(/xcatpost/|/xcatpost/_xcat|/xcatpost/_ssh|/xcatpost/ca|/xcatpost/hostkeys)$'`
/xcatpost/getpostscript.awk |sed -e 's/<[^>]*>//g'|egrep -v '^ *$'|sed -e 's/^ *//' | sed -e 's/&lt;/</g' -e 's/&gt;/>/g' -e 's/&amp;/\&/g' -e 's/&quot;/"/g' -e "s/&apos;/'/g" > /xcatpost/mypostscript

View File

@ -478,8 +478,9 @@ if grep 'rw /rw tmpfs ' /proc/mounts >/dev/null 2>&1; then
ln -sf /etc/rc6.d/K10xcatmounts /etc/rc0.d/K10xcatmounts
fi
chmod +x /$xcatpost/*;
# To support the postscripts in the subdirectories under /install/postscripts
#chmod +x /$xcatpost/*;
chmod -R +x `find $xcatpost/ -maxdepth 1 -print | grep -E -v "^($xcatpost/|$xcatpost/_xcat|$xcatpost/_ssh|$xcatpost/ca|$xcatpost/hostkeys)$"`
cd /$xcatpost;
PATH=/$xcatpost:$PATH

View File

@ -33,7 +33,9 @@ done
cd /xcatpost;
PATH=/xcatpost:$PATH
export PATH
chmod +x /xcatpost/*;
# To support the postscripts in the subdirectories under /install/postscripts
#chmod +x /xcatpost/*;
chmod -R +x `find /xcatpost/ -maxdepth 1 -print | grep -E -v '^(/xcatpost/|/xcatpost/_xcat|/xcatpost/_ssh|/xcatpost/ca|/xcatpost/hostkeys)$'`
POST_IN_DIR="/xcatpost"