From 46f9b5056cf38cf3a6e074b585c8de075da865a0 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 21 Mar 2022 15:58:50 -0400 Subject: [PATCH] Make setuppostbootscripts script recognise other settings for runbootscripts attribute --- .../common/deployment/prepostscripts/post_script.rst | 2 +- xCAT/postscripts/setuppostbootscripts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/post_script.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/post_script.rst index 4e7178097..54ab808ed 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/post_script.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/post_script.rst @@ -20,7 +20,7 @@ There are two types of scripts in the postscripts table ( postscripts and postbo Postscripts will be run after the reboot but before the ``init.d`` process. For Linux diskless deployment, the postscripts will be run at the ``init.d`` time, and xCAT will automatically add the list of postscripts from the postbootscripts attribute to run after postscripts list. * **postbootscripts attribute** - list of postbootscripts that should be run on this Linux node at the ``init.d`` time after diskful installation reboot or diskless boot -* **xCAT**, by default, for diskful installs only runs the postbootscripts on the install and not on reboot. In xCAT a ``site`` table attribute ``runbootscripts`` is available to change this default behavior. If set to ``yes``, then the postbootscripts will be run on install and on reboot. +* **xCAT**, by default, for diskful installs only runs the postbootscripts on the install and not on reboot. In xCAT a ``site`` table attribute ``runbootscripts`` is available to change this default behavior. If set to ``yes`` or ``y`` or ``1``, then the postbootscripts will be run on install and on reboot. To avoid reinstallation, run ``updatenode -P setuppostbootscripts`` command to update the value of ``runbootscripts`` attribute on the compute or service nodes. .. note:: xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. diff --git a/xCAT/postscripts/setuppostbootscripts b/xCAT/postscripts/setuppostbootscripts index 4e7846d8c..0fbd5d583 100755 --- a/xCAT/postscripts/setuppostbootscripts +++ b/xCAT/postscripts/setuppostbootscripts @@ -29,10 +29,10 @@ if [ ! -d "/opt/xcat" ]; then mkdir -p /opt/xcat fi infofile="/opt/xcat/xcatinfo" -if [ "$RUNBOOTSCRIPTS" = "yes" ] || [ "$RUNBOOTSCRIPTS" = "YES" ]; then - RUNBOOTSCRIPTS=yes -else +if [[ ! "$RUNBOOTSCRIPTS" =~ ^(1|yes|y)$ ]]; then RUNBOOTSCRIPTS=no +else + RUNBOOTSCRIPTS=yes fi # check to see if current setting is already in the file, if so nothing to do if [ -f $infofile ]; then