run postscripts on debian/ubuntu

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@15059 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
xq2005 2013-02-05 13:02:26 +00:00
parent 464bb52690
commit 5cd7d72d51

View File

@ -109,7 +109,6 @@ export PATH=/xcatpost:$PATH
# use the run_ps subroutine to run the postscripts
TMP=`sed "/postscripts-start-here/,/postscripts-end-here/ s/\(.*\)/run_ps \1/;s/run_ps\s*#/#/;s/run_ps\s*$//" /xcatpost/mypostscript`
echo "
# global value to store the running status of the postbootscripts,the value is non-zero if one postbootscript failed
return_value=0
# subroutine used to run postscripts
run_ps () {
@ -124,7 +123,7 @@ run_ps () {
./\$@ 2>&1 | tee -a $logfile
ret_local=\${PIPESTATUS[0]}
if [ \"\$ret_local\" -ne \"0\" ]; then
return_value=\$ret_local
return_value=\$ret_local
fi
else
echo "\"\`date\` Postscript \$1 does NOT exist.\"" | tee -a \$logfile
@ -157,13 +156,13 @@ if [ -f /xcatpost/mypostscript.post ]; then
RUNBOOTSCRIPTS=`grep 'RUNBOOTSCRIPTS=' /xcatpost/mypostscript.post |cut -d= -f2`
fi
if [ "$RUNBOOTSCRIPTS" != "'yes'" ]; then
chkconfig xcatpostinit1 off
update-rc.d -f xcatpostinit1 remove
fi
echo "REBOOT=TRUE" >> /opt/xcat/xcatinf
EOF
chmod 755 /opt/xcat/xcatinstallpost
chkconfig --add xcatpostinit1
update-rc.d xcatpostinit1 defaults
#create the dskls post
cat >/opt/xcat/xcatdsklspost << 'EOF'