--- SAS - Maintance ---

-- Just the Commands for HotFix runs
-- Java DeSerialization
-- Top Level Steps
-- SASJAVAInstallSteps.html
-- SASVisualAnalyticsPrintingSupport
-- https://communities.sas.com/t5/Administration-and-Deployment/Applying-hotfixes/td-p/583738
-- Security Update
-- SAS JAVA 8 Update -- 70084790

-- Prep Hotfixes
-- Apply Hotfixes
-- Rebuild & Redeploy Web Apps (Java DeSerialization)


Prep Hotfixes 
 1. Download  HOTFIX Zip files 
   I. cd /opt//sasinside/sashome/deploymntreg
  II. /opt/sasinside/sashome/SASPrivateJavaRuntimeEnvironment/9.4/jre/bin/java -jar sas.tools.viewregistry.jar
      # A new  DeploymentRegistry.txt is generated
 III. cp -p  DeploymentRegistry.txt /usr/local/src/HOTFIXFINDER/.  
  IV. cd /usr/local/src/HOTFIXFINDER
   V. ./SASHFADD.pl )
   
      
		** SAS Hot Fix Analysis, Download and Deployment Tool Ver. 2.2 **
		Enter a descriptive name of the machine that contains the SAS deployment
		or press "Enter" to accept a default name: 
		hfclient@sftp1.sas.com's password:  anonymous 
		sftp> cd /hotfix/HF2/util01/SASHotFixDLM/data
		sftp> get SAS94_HFADD_data.xml
		sftp> quit     
		SASHFADD processing complete! 
		SASHFADD output written to directory:
 		-> SASHFADD_2021_4_28_08.32.50... 
                       This is a unique file for each run so the following are 'By Example'!
      
  VI. cd SASHFADD_2021_4_28_08.32.50
 VII. cd DOWNLOAD_SASHFADD_2021_4_28_08.32.50
VIII. ./sftp_script.sh

		hfclient@sftp1.sas.com's password: anonymous
   
      < zips files download >
      
      ZIP files downloaded into /usr/local/src/HOTFIXFINDER/SASHFADD_2023.*/DEPLOY_SASHFADD_2023*

      --  PUT THE NEW HOTFIXES INTO THE Dir DeploymentNamger uses.
      cd  /usr/local/src/HOTFIXFINDER/SASHFADD_2021_4_28_08.32.50/DEPLOY_SASHFADD_2021_7_08_07.56.04
      cp -p *.zip /opt/sasinside/sashome/InstallMisc/HotFixes/New/.

   IX. cd  /usr/local/src/HOTFIXFINDER/SASHFADD_2021_4_28_08.32.50/ANALYSIS_SASHFADD_2021_4_28_08.32.50
       sftp SAS_Hot_Fix_Report_2021_4_28_08.32.50.html to a web server document home
       chmod 744 Fix_Report_2021_4_28_08.32.50.html

 2. Stop crontab
    systemctl stop crond
    systemctl status crond
   
 3. Stop ALL SAS processes
     ### Stop the LASRServer in a browser
     https://busas.binghamton.edu:8343

     ### Stop the system level processes: ./SAS.Services stop
 	 cd /opt/sasinisde
 	 ./config/midtier/Lev1/sas.servers stop 
	 ./config/compute/Lev1/sas.servers stop
	 ./config/metadata/Lev1/sas.servers stop

     ### If any sas services still running ...Kill as root : [sas@busas]$ sudo su -
     ps -ef |egrep ^sas | egrep -v  'grep|tty|sshd|TKGrid' | awk '{print "kill -9 "$2}'
     ps -ef |egrep  TKG | egrep -v grep | awk '{print "kill -9 "$2}'
     [sas@busas]$ Ctrl c

Apply Hot Fixes 
4. Apply hot fixes via SAS Deployment Manager -  Deployment User Guide
    Start Deployment Manager as users SAS
    /opt/sasinside/sashome/SASDeploymentManager/9.4/sasdm.sh  
    Find Apply Hot Fixes and click Next.
   
 5. If required per POST-INSTALLATION INSTRUCTIONS Re-Apply security updates from SAS 
    (This is performed outside SAS Deployment Manager) SAS Security Updates

 Rebuild Web Applications 
 6a. Rebuild Web Applications https://documentation.sas.com/?cdcId=bicdc&cdcVersion=9.4&docsetId=bimtag&docsetTarget=p0plwle8uj04upn1vrsbstiwkhmz.htm&locale=en
    Start Deployment Manager as users SAS
    /opt/sasinside/sashome/SASDeploymentManager/9.4/sasdm.sh  
    Find Rebuild Web Applications and click Next.
 
 7. Re-start all SAS sessions, daemons, spawners and servers except for Web Application Servers. 
    While not documented as a best practice...
      No point in starting the Web Application Servers when 
      Redeploy task will stop them as a first step

Redeploy Web Applications --- Java DeSerialization
 8. Redeploy Web Applications https://documentation.sas.com/?cdcId=bicdc&cdcVersion=9.4&docsetId=bimtag&docsetTarget=n02nbqc1n26j7gn1lgpbgss3ev8p.htm&locale=en
    Java Deserialization if needed must be done first ...
       cd /opt/depot/JAVA-DeSerialization/sas-security-update-2020-08
       ./install.sh /opt/sasinside/sashome
       
    Start Deployment Manager as users SA
    /opt/sasinside/sashome/SASDeploymentManager/9.4/sasdm.sh  
    Find Deploy Web Applications and click Next.
    
 9. Restart all services for good measure and check for clean logs prior to performing a quick test.
    ### Start the system level processes: ./SAS.Services start
    cd /opt/sasinside
    ./config/metadata/Lev1/sas.servers start
    ./config/compute/Lev1/sas.servers start
    ./config/midtier/Lev1/sas.servers start  

     ### Status and if  not running Start 
     /opt/sasinside/config/compute/Lev1/Applications/SASInformationRetrievalStudioforSAS/bin/ContentIndexServer-Status.sh

     ### Manually start each one...
     cat /opt/sasinside/config/compute/Lev1/Applications/SASInformationRetrievalStudioforSAS/bin/ContentIndexServer-Start.sh
     /opt/sasinside/config/compute/Lev1/ObjectSpawner/ObjectSpawner.sh status

     ### ... if not running ...
     /opt/sasinside/config/compute/Lev1/ObjectSpawner/ObjectSpawner.sh start 

     ### Highperformant LASR Memory Monitoring
     /opt/sasinside/config/compute/Lev1/Applications/SASVisualAnalytics/HighPerformanceConfiguration/LASRMonitor.sh status

     ### ... if not running ...
     /opt/sasinside/config/compute/Lev1/Applications/SASVisualAnalytics/HighPerformanceConfiguration/LASRMonitor.sh start

     ### Check Start the LASR Server
     https://busas.binghamton.edu:8343

10. Start  crontab
    systemctl start crond 
    systemctl status crond    




The Hotfix Steps cd /opt/sasinside/sashome/InstallMisc/HotFixes/New Arrow key down the the Download string for the hotfix zip to download, hit Return ### Stop all services /opt/sasinside/config/midtier/Lev1/sas.servers stop /opt/sasinside/config/compute/Lev1/sas.servers stop /opt/sasinside/config/metadata/Lev1/sas.servers stop ### Stop the LASRServer https://busas.binghamton.edu:8343 ### Stop crontab systemctl stop crontd systemctl status crontab ### Do a Backup dsmc i /opt/sasinside/config ### HotFix Installs /opt/sas/inside/sashome/SASDeploymentNanager/9.4/sasdm.sh Apply Hot Fixes ### start metadata /opt/sasinside/config/metadata/Lev1/sas.servers start /opt/sas/inside/sashome/SASDeploymentNanager/9.4/sasdm.sh Rebuild Web Applications Select /opt/sasinside/config/midtier login Select the correct Product Configuration #--- Redeploy Web Applications Select /opt/sasinside/config/midtier login Select the correct Product Configuration Do the JAVA|JRE update maybe. rm -rf /opt/sasinside/config/compute/Lev1/Applications/SASInformationRetrievalStudioforSAS/work/index/* ### Start all services /opt/sasinside/config/metadata/Lev1/sas.servers start /opt/sasinside/config/compute/Lev1/sas.servers start /opt/sasinside/config/midtier/Lev1/sas.servers start ### Start the LASRServer https://busas.binghamton.edu:8343 ### Start crontab systemctl start crontd systemctl status crontab ### Do VALIDATIONS as appropriate

Valid HTML 4.0 Transitional