#2593 Cleanup code which gens mypostscript for full install

2.7.1
closed
5
2012-10-18
2012-02-14
No

On Linux there are a group of scripts in /opt/xcat./share/xcat/install/scripts that are used to generate the /tmp/mypostscript for full disk installs.
The scripts are written for each OS and versions of OS. A lot of code is common.
1) Extract the common code for generating the mypostscript file and make it common across all scripts
2) Move the creation of the mypostscript file from /tmp/mypostscript to /xcatpost/mypostscript
3) Change the logic in the run_ps routine as appropriate for the changes above.
4) If not already done, add timestamps on the running of the postscripts and start and stop headers in /var/log/xcat/xcat.log

Discussion

  • Guang Cheng Li

    Guang Cheng Li - 2012-02-16

    Lissa,

    I have some comments/questions for the items you listed in the bug.

    1) I think the scripts in /opt/xcat./share/xcat/install/scripts are not used for mypostscript, the scripts are used to generate the kickstart/autoyast files. The most important scripts are post.rh, post.sles, pre.rh and pre.sles; all the other scripts are customized version based on these four basic files, the customized version might have a lot of differences with the original one, I am not sure how easy it will be to extract the common code.

    2) The mypostscript file location is different on Linux and AIX, when you said move the mypostscript file from /tmp/mypostscript to /xcatpost/mypostscript, do you mean to make it consistent between AIX and Linux?

    3) yes, the run_ps routine might need to be updated

    4) You opened priority 7 bug 3487363 for the time stamp requirement.

    So, seems to me that only the item #2 and #3 are needed to be done through this bug. For item #1, we may want to add a wishlist item to address this, I have a feeling that it is too big for a bug.

    Any further comments?

     
  • Guang Cheng Li

    Guang Cheng Li - 2012-02-16

    I was wrong. The /opt/xcat./share/xcat/install/scripts are used generate mypostscript for the diskful installation. It does make things be more complex when we need to update the content or format of mypostscript.

    For diskless nodes, the xcatdsklspost will generate the mypostscript, I am wondering if we want to use a single script to handle the mypostscript generate for both the diskful and diskless nodes. But again, it might be too big for a bug...

     
  • Bruce

    Bruce - 2012-02-16

    Combining bug 3487363 into this one because they are closely related:

    When creating the xcat.log during the node install, we need to add putting timedate stamps on entries in /var/log/xcat/xcat.log
    Please add this to the script generated. We need at least at the start and stop of each entry since this long is an accumulation of all runs of install and updatenode. See suggesting below.

    subroutine used to run postscripts

    run_ps () {
    logdir="/var/log/xcat"
    mkdir -p $logdir
    logfile="/var/log/xcat/xcat.log"

    if [ -f $1 ]; then
    echo "Running postscript: $@" | tee -a $logfile <---- here add a time/date
    ./$@ 2>&1 1> /tmp/tmp4xcatlog
    cat /tmp/tmp4xcatlog | tee -a $logfile
    else
    echo "Postscript $1 does NOT exist." | tee -a $logfile <---- add a time/date
    fi
    }

    subroutine end

     
  • Guang Cheng Li

    Guang Cheng Li - 2012-02-17

    Bug 3392028 also proposes the postscripts directory related stuff.

     
  • Bruce

    Bruce - 2012-03-07

    Adding another requirement to this bug (moved here from bug 3497125):

    For updatenode, when running postscripts it doesn't show the output of a postscript until the postscript finishes. I think this is because of the following lines in run_ps:

    ./$@ 2>&1 1> /tmp/tmp4xcatlog
    cat /tmp/tmp4xcatlog | tee -a $logfile

    Can this be changed to:

    ./$@ 2>&1 | tee -a $logfile

    This becomes a problem, for example, in the following scenario: the cfgloc was bad on the SN, so when xcat was being installed via otherpkgs and restarting xcatd, it retried to connect to the db many times and took 20 minutes to install. During that whole time, i saw no output from updatenode -V from the otherpkgs postscript.

     
  • Guang Cheng Li

    Guang Cheng Li - 2012-03-21

    Will work on it. Hua Zhong has some other priorities to work in 2.7.1.

     
  • Lissa Valletta

    Lissa Valletta - 2012-03-21

    Additional requirement
    Change all logger calls (in xCAT) to this format logger -p local4.info -txCAT <msg>, to put all xCAT syslog entries under local4 facility. Currently inconsistent. MsgUtils uses local4, logger calls uses "user". This is important so we can filter all xCAT entries to a logfile.

     
  • Guang Cheng Li

    Guang Cheng Li - 2012-03-31

    For changing the logger -p local4, we may not want to use local4.info for all the logger commands, for the errors, we should use local4.err. There are a lot of message levels:

    alert, crit, debug, emerg, err, error (deprecated synonym for err), info, notice, panic (deprecated synonym for emerg), warning, warn (deprecated synonym for warning)

    We do not need to support all of these levels, but at least we need to put errors and info into different levels.

    There are more than 350 places xCAT calls logger, I do not think we should do this in 2.7.x, I opened a new xCAT 2.8 bug https://sourceforge.net/tracker/?func=detail&aid=3513525&group_id=208749&atid=1006945 to address this.

     
  • Guang Cheng Li

    Guang Cheng Li - 2012-04-01

    Fixed in xCAT 2.7 and 2.8, on Linux and AIX.

    Linux diskful:

    1) Extract the common code for generating the mypostscript file and make it common across all scripts

    2) Move the creation of the mypostscript file from /tmp/mypostscript to /xcatpost/mypostscript

    3) add timestamps on the running of the postscripts and start and stop headers in /var/log/xcat/xcat.log

    4) ./$@ 2>&1 | tee -a $logfile

    Linux diskless:

    1) Move the creation of the mypostscript file from /tmp/mypostscript to /xcatpost/mypostscript

    2) add timestamps on the running of the postscripts and start and stop headers in /var/log/xcat/xcat.log

    3) ./$@ 2>&1 | tee -a $logfile

    AIX diskful and diskless:

    1) add timestamps on the running of the postscripts and start and stop headers in /var/log/xcat/xcat.log

     
  • Lissa Valletta

    Lissa Valletta - 2012-10-18
    • status: pending --> closed