/DD-2/Work-BU-Docs/REBOOTS/General-Reboot_instructions.TXT AS root # ####################################################### # LOG what is running on the server before the reboot # ####################################################### systemctl --no-pager | grep running > /var/tmp/after-reboot # ################################################################ # GENERATE a script to start services ## ## You MAY use the /var/tmp/START-Services scipt after the reboot. # ################################################################ systemctl | egrep 'appworx|badm|banjob|cbagentcvunlock|commvault|httpd|jenkins|mysql|mariadb|nginx|oni|oracle|postgres|rhns|rabbit|snmptrapd|snmptrapd|snapd|tomcat|avahi|graylog' \ | cut -c1-90 | egrep -v 'apparmor|target|seeded|socket|mount|session|smart|stat|user|lvm' | sort -u | awk '{print "systemctl start "$1}' >/var/tmp/START-Services # ##################################################################### # GENERATE a script to status services ## ## You will run this script /var/tmp/STATUS-Services after the reboot. # #################################################################### systemctl | egrep 'appworx|badm|banjob|cbagentcvunlock|commvault|httpd|jenkins|mysql|mariadb|nginx|oni|oracle|postgres|rhns|rabbit|snmptrapd|snmptrapd|snapd|tomcat|avahi|graylog' \ | cut -c1-90 | egrep -v 'apparmor|target|seeded|socket|mount|session|smart|stat|user|lvm' | sort -u | awk '{print "systemctl status "$1}' >/var/tmp/STATUS-Services # #################################################################### ## NOW one this one... ## stop the services one at atime. ## Order doesn't generall matter... ### STOP TOMCAT BEFORE HTTPD # #################################################################### systemctl | egrep 'appworx|badm|banjob|cbagentcvunlock|commvault|httpd|jenkins|mysql|mariadb|nginx|oni|oracle|postgres|rhns|rabbit|snmptrapd|snmptrapd|snapd|tomcat|avahi|graylog' \ | cut -c1-90 | egrep -v 'apparmor|target|seeded|socket|mount|session|smart|stat|user|lvm' | sort -u | awk '{print "systemctl stop "$1}' >/var/tmp/STOP-Services cat /var/tmp/STOP-Services # ####################################################################### ## This run should return nothing if all the stop servies ran correctly. # ####################################################################### systemctl | egrep 'appworx|badm|banjob|cbagentcvunlock|commvault|httpd|jenkins|mysql|mariadb|nginx|oni|oracle|postgres|rhns|rabbit|snmptrapd|snmptrapd|snapd|tomcat|avahi|graylog' \ | cut -c1-90 | egrep -v 'apparmor|target|seeded|socket|mount|session|smart|stat|user|lvm' | sort -u | awk '{print "systemctl stop "$1} # ####################################################################### ### CHeck what services are still running, these should be OK ... ### However See below # ####################################################################### ps -ef | egrep -v 'gdm|root' # ####################################################################### ## BELOW ## if any oracle, banner, appworx, etc are still running .. ## ## use the init.d scripts below for any services that match one of these # ####################################################################### cd /etc/init.d /etc/init.d/appworx stop /etc/init.d/banjob stop /etc/init.d/cbagentd stop /etc/init.d/Galaxy stop /etc/init.d/gcstartup stop /etc/init.d/graylog-server stop /etc/init.d/httpd stop /etc/init.d/init.oracle stop /etc/init.d/init.tomcat stop /etc/init.d/init.weblogic stop #/etc/init.d/jenkins-agent stop /etc/init.d/mysql stop /etc/init.d/mysqld stop /etc/init.d/oddjobd stop /etc/init.d/oracle_init stop /etc/init.d/oracle.init stop /etc/init.d/postgresql stop /etc/init.d/rabbitmq-server stop /etc/init.d/rhnsd stop /etc/init.d/sendmail stop /etc/init.d/spice-vdagent stop /etc/init.d/splunk stop /etc/init.d/splunkd stop ## ######################################## ## Always run these two if they are found. ## ######################################## /etc/init.d/cbagentd stop /etc/init.d/gcstartup stop ## ############################################################## ### check AGAIN if any services still running ### run the init.d and check again with systemctl if necessary. ## ############################################################## ps -ef | egrep -v 'gdm|root' ## ############################################################## ## in VMWare ## Launch a REMOTE or WEB CONSOLE ... ### for the server to be rebooted to monitor the reboot ## in VMWare ## ############################################################## ## ############################################################## ## 3 syncs and a reboot ## ############################################################## sync sync sync reboot ## ############################################################## ## Watch the activity in the CONSOLE, note an anomolies. ## login when it is back up ## ## Run each status one at a time, ## A q might be needed to break out of the status. ## ############################################################## cat /var/tmp/STATUS-Services ## ############################################################## # If it isn't running change the status to start and run it. ## ############################################################## ## ############################################################## ## what is running on the server after the reboot ## ### There should be very few lines and no services found not ### running. ## ############################################################## systemctl --no-pager | grep running > /var/tmp/after-reboot diff /var/tmp/before-reboot /var/tmp/after-reboot