This document describes everything there is to know regarding Upgrade-UX, an Open Source upgrade and patching framework designed to assist the UNIX system engineer in patching or upgrading systems in a consistent and repeatable way with evidence before and after the running upgrade-ux.

1. Introduction

Upgrade-UX is ai software framework to update or patch lots of Unix systems (Linux, HP-UX, AIX and Solaris).

In professional environments it is not allowed to just blindly update an UNIX system without testing this first out on a development system, pre-production and so on. The upgrade-ux product allows you to repeat this process in a consistent way and as many times as you like on any system. Upgrade-ux understands two states:

  • preview mode: will go through the whole process without actually doing the update

  • upgrade mode: will do it for real (the update)

The upgrade-ux uses configuration files which describes what a particular Unix Operating System requires to be upgraded in the way you want it (or designed it). Doing it this way allows you to exactly define how a system should look like after the upgrade or patching. Nothing else can be installed, removed or configured.

Furthermore, many checks can be built-in via adding simple scripts (see chapter "Adding your scripts"). We also keep of each run an unique log file, and furthermore, we keep evidence before and after patching in a special directory. Months later we can still inspect these logs and evidence directories to verify what happened or what has changed in the meantime.

1.1. Upgrade-UX project

The support and development of the Upgrade-UX project takes place on Github:

In case you have questions, ideas or feedback about this document, you can contact the development team at: gratien.dhaese@gmail.com.

1.2. Design concepts

Based on experience from previous projects, a set of design principles were defined, and improved over time:

  • Focus on easy and repeatable tasks

  • Modular design, focused on system administrators

  • For Unix operating systems

  • Few external dependencies (ksh and standard Unix tools)

  • Easy to use and easy to extend

The goal is to make Upgrade-UX as least demanding as possible, it will require only the applications necessary to fulfill the job upgrade-ux is configured for.

1.3. Features and functionality

Upgrade-UX has a wide range of features:

  • Simple to use

  • Has a preview mode (to dry-run an upgrade without doing it) and an upgrade mode

  • Is customisable via local.conf configuration file

  • Is written in standard Korn Shell (which makes it highly portable)

  • Is UNIX Operating System independent as OS specific tasks reside in their own directory structures

  • Is easy extendable with your own scripts

  • The upgrade-ux command leaves a trace in its own log file

  • Running in preview or upgrade mode always creates evidence files

  • Has a man page

  • Has user documentation (you are reading it)

  • Can be used to install patch bundles of previous years with the YEAR variable

  • Does understand Serviceguard clusters

  • Can be programmed to bail out on settings you think are too serious to continue

  • Can trigger remote alarms, syslog, monitors,…

  • Can do a basis health check of your system - it is all up to you

  • Has excellent support by its author

2. Getting started

You can use upgrade-ux via installing the sources or the software depot (HP-UX, Linux,…)

2.1. Clone the sources via GitHub

The latest sources are available at GitHub and to clone the sources on your local Unix you could use

git clone git@github.com:gdha/upgrade-ux.git

To enter the directory use the command

cd upgrade-ux/opt/upgrade-ux

2.2. Installing the software depot on HP-UX

If the software depot was already been made available by the system administrator then you can use swinstall to do the job. To install Upgrade-UX on HP-UX run the following command swinstall -s SDserver:/var/opt/ignite/depots/GLOBAL/tools/11i UPGRADE-UX

2.3. Installing the RPM package on Linux (RHEL, SLES)

When the RPM is available you could install it via the command:

rpm -ivh upgrade-ux-1.0-1.el7.noarch.rpm

Or, in case you would like to upgrade a version via yum you could do the following:

rpm -Uvh upgrade-ux-1.1-1.el7.noarch.rpm

2.4. Prerequisites

Be aware, that upgrade-ux is completely written in Korn Shell, therefore, you must have the ksh executable on your UNIX system. To be sure you could type which ksh. If it is not present please install it first (most likely on Linux where it is not a standard package in base OS).

3. Configuration

The configuration files that upgrade-ux uses are basically just shell scripts and should be treated as such.

The default location of the configuration files is /etc/opt/upgrade-ux/. However, if you are working with the sources (e.g. via git clone) then it is perfectly possible to use the relative paths, e.g.

ls $HOME/project/upgrade-ux/etc/opt/upgrade-ux/

The easiest way to explain which configuration files are possible is by showing the output of the upgrade-ux dump command:

$ sudo /opt/upgrade-ux/bin/upgrade-ux dump
upgrade-ux 1.27 / 24-Aug-2022
Using log file: /var/opt/upgrade-ux/log/upgrade-ux-20221128-1005-ITSGBHHLSP00741.log
Dumping out configuration and system information
This is a 'Linux-x86_64' system, compatible with 'Linux-i386'.
System definition:
                                    ARCH = Linux-i386
                                      OS = GNU/Linux
                        OS_MASTER_VENDOR = fedora
                       OS_MASTER_VERSION = 8
                   OS_MASTER_VENDOR_ARCH = fedora/x86_64
                OS_MASTER_VENDOR_VERSION = fedora/8
           OS_MASTER_VENDOR_VERSION_ARCH = fedora/8/x86_64
                               OS_VENDOR = rhel
                              OS_VERSION = 8
                          OS_VENDOR_ARCH = rhel/x86_64
                       OS_VENDOR_VERSION = rhel/8
                  OS_VENDOR_VERSION_ARCH = rhel/8/x86_64
Configuration tree:
                         Linux-i386.conf : missing/empty
                          GNU/Linux.conf : OK
                             fedora.conf : OK
                      fedora/x86_64.conf : missing/empty
                           fedora/8.conf : missing/empty
                    fedora/8/x86_64.conf : missing/empty
                               rhel.conf : missing/empty
                        rhel/x86_64.conf : missing/empty
                             rhel/8.conf : missing/empty
                      rhel/8/x86_64.conf : missing/empty
                               site.conf : missing/empty
                              local.conf : OK
                   Linux-rhel-8-2022.ini : OK

3.1.1. Default configuration file default.conf

The default.conf contains lots of variables which should not be changed by the end-user. If you wish to modify one just redefine it in the local.conf file.

A good example of such variable is the YEAR. In the default.conf it is defined as:

# The default year to use with our patch bundle is *current year* [ $(date '+%Y') ] - to overrule define it manually
# in the local.conf file. E.g. when running upgrade-ux in 2015 but still installing patches from 2014 then define: YEAR=2014
YEAR=$(date '+%Y')

However, in some cases as mentioned above, if you are in the year 2015 and you still want to install patch bundles of 2014 then it is necessary to define the YEAR variable in the local.conf file, as YEAR=2014 (or whatever, the year might be).

3.1.2. Local configuration file local.conf

The local.conf should only contain variables which you want to overrule, as described in previous section (of the default.conf file). It is important to know that the local.conf file is the last configuration file read by upgrade-ux script and therefore, the variables defined in there are the last ones that will be used.

3.1.3. Exclude packages from the update process

The /etc/opt/upgrade/exclude.packages file contains a list of packages you wish to exclude from the update. This file is the same for HP-UX or Linux. A safe-guard is built-in to remove packages which are not found (installed) on current system. Use one line per package you wish to exclude. This file is not mandatory, so it does not have to exist for upgrade-ux to work properly (nothing will be excluded then).

3.1.4. Operating Specific configuration files

On each OS you have specific OS related configuration files, e.g.

HP-UX.conf
GNU/Linux.conf
SunOS.conf

These configuration files typically contain variables which have only a meaning within that specific OS, e.g. on HP-UX

SWINSTALL=/usr/sbin/swinstall

3.2. The INI files

The INI files are always OS specific and contain the definitions of which patch bundles should be installed or removed, and so on. The INI files are kept under the /etc/opt/upgrade-ux or $HOME/project/upgrade-ux/etc/opt/upgrade-ux/ directory and are typically called $OS-$OS_VERSION-$YEAR.ini

It follows also the different stages known within upgrade-ux and these are best explained with an example INI file (below you see the INI file for HP-UX 11.11 systems):

# HP-UX-11.11-2014.ini file
###########################
#
###################
# section preremove - which sd depots must be removed before we install the latest one (or even run update-ux)
###################
[preremove]
    command[0]      =       $SWREMOVE
    options[0]      =       "-x mount_all_filesystems=false  -x enforce_dependencies=false"
    bundle[0]       =       CFG2HTML
    version[0]      =       "C.06.*"         ; cfg2html
command[1]      =       $SWREMOVE
options[1]      =       "-x mount_all_filesystems=false  -x enforce_dependencies=false"
bundle[1]       =       NCS_UTILS
version[1]      =       "*"
####################
# section preinstall - anything to do before running the installation of patches, software or update-ux
####################
[preinstall]
#################
# section install - what shall we do during the installation phase
#################
# please list the software bundles which do not require a reboot first!!!
[install]
    # SecureShell
    command[0]      =       $SWINSTALL
    options[0]      =       "-x mount_all_filesystems=false"
    source[0]       =       "-s $SDSERVER:/var/opt/ignite/depots/GLOBAL/SSH/11.11"
    bundle[0]       =       T1471AA
    version[0]      =       A.06.20.004
# the centrifyDC is the same for all HP-UX 11i versions
command[1]      =       $SWINSTALL
options[1]      =       "-x mount_all_filesystems=false"
source[1]       =       "-s $SDSERVER:/var/opt/ignite/depots/GLOBAL/centrify/11.11/V5"
bundle[1]       =       "CentrifyDC"
version[1]      =       "5.1.1-831"
command[2]      =       $SWINSTALL
options[2]      =       "-x mount_all_filesystems=false"
source[2]       =       "-s $SDSERVER:/var/opt/ignite/depots/GLOBAL/centrify/11.31/V5"
bundle[2]       =       "Centrify_conf"
version[2]      =       "5.1.x"
command[3]      =       $SWINSTALL
options[3]      =       "-x mount_all_filesystems=false -x autoreboot=true"
source[3]       =       "-s $SDSERVER:/var/opt/ignite/depots/GLOBAL/jnjdrv11-11-may2014"
bundle[3]       =       "*"
version[3]      =       ""
#####################
# section postinstall
#####################
# Use this section for additional (internal) software bundles - we assume no reboots are required
[postinstall]
####################
# section postremove
####################
[postremove]
###################
# section configure
###################
# or define explicit commands (real cmds) with options or define script tag [string] which
# may be picked up by a script (under scripts/configure/default/)
[configure]
    command[0]      =       uncomment_cfg2html_in_crontab
    options[0]      =       ""
#################
# section cleanup
#################
[cleanup]
#####################
# section postexecute
#####################
[postexecute]
    command[0]      =       "/opt/cfg2html/bin/cfg2html"
    options[0]      =       "-2%Y%m%d"

3.2.1. The INI syntax

You can use as many comments as you like, but it should start with # or ; sign.

A stage or section is started with [section] header. The name within a section is known as a stage within upgrade-ux.

A section may be empty or may contain arrays (some of those may be left out and will be treated as empty strings). An array will always be treated as a string by the way. The content of arrays are wiped out when you enter a new stage (or section) by upgrade-ux.

The following arrays are known to upgrade-ux:

  • command[] - add the command to be executed (it can be a variable name, e.g. $SWINSTALL)

  • options[] - add here specific options required by command[]

  • source[] - should be the source location where the software bundle reside

  • bundle[] - the name of the software bundle

  • version[] - the specific version to be installed/removed (can contain * or may be empty as well)

If you do not need all arrays in a certain section then it is fine to leave these empty (or not mentioning these in the INI file)

Be careful although that you define the array index correctly in the INI file (see example above).

3.2.2. Section preremove

In the preremove section you typically define lines of software bundles that should be removed for one of other reason, e.g. when upgrading these would be problematic (in the way the software was designed - read badly). As said, if not needed leave this section empty.

3.2.3. Section preinstall

In the preinstall section we could define some commands that need to be run, but in most case we write small scripts to do specific tasks in this stage (or section) such as stopping some daemons, saving evidence of software inventory and so on. More about thiese scripts in Chapter 6 (The Upgrade-ux scripts).

3.2.4. Section install

In the install section you typically only define the software bundles that should be installed and in the right order. For example, for update the installation software (update-ux or yum) before the new updates. In this stage we do not have much special scripts.

3.2.5. Section postinstall

In the postinstall section we define the software pieces that were missing in the install section for some specific reason (if any). Furthermore, in this stage we capture lots of evidence again and compare these via special scripts. Again see Chapter 6 (The Upgrade-ux scripts).

3.2.6. Section postremove

In the postremove section you could remove software bundles that were in the big update round of the install section, but should not stay on this particular platform for some reason. Again, you may leave it empty if not needed.

3.2.7. Section configure

In the configure section you could define scripts or commands to be executed by upgrade-ux to configure or add something in cron. See also the example shown above with uncomment_cfg2html_in_crontab, which is a toggle meant for a script called /opt/upgrade-ux/scripts/configure/default/10_configure_commands.sh that simply touches a file under $TMP_DIR

Another way to had this defined would have been:

command[0]="touch"
options[0]="$TMP_DIR/uncomment_cfg2html_in_crontab"

3.2.8. Section cleanup

In the cleanup section we could add commands to remove some old log files (of older software bundles), or you can also use it to report errors or any other message. The section is typically empty, but you could add some special scripts under /opt/upgrade-ux/scripts/cleanup/default/

3.2.9. Section postexecute

In the postexecute section you could define commands and options of things you want to execute, e.g.

command[0]      =       "/opt/cfg2html/bin/cfg2html"
options[0]      =       "-2%Y%m%d"

4. Workflows

The workflows (or commands) available can be listed with the -h option:

4.1. Dump workflow

The dump workflow was already discussed during the configuration chapter. The output of /opt/upgrade-ux/bin/upgrade-ux dump:

The first part displays the system definitions, such as OS, hardware type and OS version. The second part shows the configuration part and which files it could find (or you may define, create and/or use). They do not need to exist.

The following example shows the dump on a RHEL 7 system:

These configuration files live under the /etc/opt/upgrade-ux or ./upgrade-ux/etc/opt/upgrade-ux (relative path) directory. At this moment we have the following configuration files present (however, it will grow over time):

4.2. Mkdist workflow

The mkdist workflow creates a compressed tar file of the current development tree, which only makes sense when you are using the git clone version of upgrade-ux. The compressed tar file is stored under /tmp file system and is called /tmp/upgrade-ux-0.9.tar.gz (the version can be different of course).

4.3. Purgelogs workflow

The purgelogs workflow just has a simple function and that is to purge log files which are older than 30 days. It will display the logs it has purged (only when you are using the option -v):

4.4. Test workflow

The test workflow is a very simplistic test (use option -v to see something):

4.5. Upgrade workflow

The upgrade workflow is the real work horse here and in fact is the default workflow (meaning if no workflow is mentioned we will assume you mean upgrade).

The upgrade workflow has two modes:

  • preview mode: is going through the complete flow checking all software and simulating an update of the system. Is a perfect way to examine your system to see whether any underlying issues could prevent a successful upgrade. You can do the preview (option -p) any time and as much as you like. However, before doing the upgrade mode you are forced to go through a successful preview mode as well.

  • upgrade mode: is doing again all the checks, writing evidence and applying all the patch bundles or doing the upgrade. The system might reboot. After the reboot you can continue with retyping /opt/upgrade-ux/bin/upgrade-ux -v and it will continue from the point it was interrupted by the reboot as upgrade-ux keeps track of it stages.

5. Basic Usage

Before digging deeper in upgrade-ux lets explain the basic usage. The option help (-h) will produce the following:

Keep in mind that upgrade-ux has an excellent man page too. See man 8 upgrade-ux

It is important to know that upgrade-ux is a quiet program and will not show any output if you do not request for it with the verbose option (-v). Another point of interest is its excellent logging facilities as under /var/opt/upgrade-ux/log directory upgrade-ux keep a log file of each run. The log files are composed as follow upgrade-ux-<YYYYMMDD>-<HHMM>-hostname.log

We already mentioned the evidence files which are kept under /var/opt/upgrade-ux/<YYYY-MM-DD>/ directory. The type of files you find under there are of course different according the OS, OS version and which software is installed. Furthermore, preview and upgrade mode may result in more or less evidence files.

Starting up the program should be done by referencing the full path /opt/upgrade-ux/bin/upgrade-ux as the directory is not part of the PATH variable, and we prefer to keep it this way to avoid accidents.

You probably understood by now that upgrade-ux must be started in preview mode first before we can run it in upgrade mode. However, we prefer that you always use the option -p (preview mode) to make it clear to yourself and other (when they need to dig into the log files for some reason) what you meant. Furthermore, in the log file there is always a trace of in which mode the program was running:

2014-06-10 15:22:45 Check if our PID (11950) is locked
2014-06-10 15:22:45 Found /tmp/upgrade-ux-LOCKDIR/upgrade-ux-PIDFILE file - we could be locked...
2014-06-10 15:22:45 lock is stale (6607) - will continue
2014-06-10 15:22:45 lock succeeded: 11950 - /tmp/upgrade-ux-LOCKDIR/upgrade-ux-PIDFILE
2014-06-10 15:22:47 upgrade-ux 0.7 / 03-Jun-2014
2014-06-10 15:22:47 Command line options: /opt/upgrade-ux/bin/upgrade-ux -v
2014-06-10 15:22:47 Using log file: /var/opt/upgrade-ux/log/upgrade-ux-20140610-1522-hostname.log
2014-06-10 15:22:47 Including /opt/upgrade-ux/lib/progresssubsystem.nosh
2014-06-10 15:22:47 Including /etc/opt/upgrade-ux/HP-UX.conf
2014-06-10 15:22:47 Including /etc/opt/upgrade-ux/local.conf
2014-06-10 15:22:47 Running upgrade workflow
2014-06-10 15:22:47 Running 'init' stage
2014-06-10 15:22:47 Including init/default/03_prepare_tmp_build_area.sh
2014-06-10 15:22:47 Including init/default/04_create_var_dir.sh
2014-06-10 15:22:47 Including init/default/05_select_ini_file.sh
2014-06-10 15:22:47 Found ini file /etc/opt/upgrade-ux/HP-UX-11.11-2014.ini
2014-06-10 15:22:47 Including init/default/08_set_preview_var.sh
2014-06-10 15:22:47 Including init/default/10_check_current_status.sh
2014-06-10 15:22:47 Including init/default/12_upgrade_allowed.sh
2014-06-10 15:22:47 Including init/default/15_check_preview_run.sh
2014-06-10 15:22:47 Last preview run was executed on Tue Jun 10 14:28:36 METDST 2014  (preview ended successfully)
2014-06-10 15:22:47 Running in "upgrade mode"
2014-06-10 15:22:47 =-=-=-=-=-=-=-=-=-=-=-=-=

From the Chapter "Workflow" you probably remember that the default workflow is upgrade (even if you did not mention it). So, as example running upgrade-ux in preview mode with verbose option is done as /opt/upgrade-ux/bin/upgrade-ux -vp

The last option that we bring to your attention in this Chapter is the force option (-F) which is handy in situation that for some reasons upgrade-ux does not want to continue due to serious software (patches) problems. For example, within HP-UX we run the check_patches command which when errors are detected will force an exit from upgrade-ux so that the System Administrator can first fix these patches (or any other issue) before re-running upgrade-ux again. We have seen cases it was impossible to get everything fixed and for that reason you may use the force option, but please do not use it by default.

Note
We advise to run the preview mode a few weeks in advance, but on a given day we must run the preview first again before we can run in upgrade mode. This is done on purpose to avoid mistakes.

6. Upgrade Operation

The upgrade operation (or workflow) is the default one and does not need to be mentioned explicitly on the command line. The upgrade operation goes through different stages to accomplish a successful upgrade or patch installation. The stages in use are:

init

The init stage is what we call the initialization stage where we create a temporary work directory, read the INI file, decides if we are running in preview or upgrade mode, read the current status

prep

The prep stage is the preparation stage where we can save, copy lots of files as evidence (before we start patching). You could also use it to investigate if the health of the system is good enough to start with an upgrade and if not, warn the user and exit.

preremove

The prepremove stage is doing what its name applies - remove software before upgrading. It may be a handy if you know old pieces of software could lead to inconsistencies. Usually, we make sure that a more recent version gets installed during or after the upgrade.

preinstall

The preinstall stage is used by scripts to stop daemons and other processes which may generate conflicts during the upgrade.

install

The install stage is the part where we actually install software, do the patching or start with the updates of software bundles and drivers. This part must be described in the INI file (install section).

postinstall

The postinstall stage is mainly used to install extra software bundles which were not part of the global patch bundles or update depots. Also here, these must be described in the INI file (postinstall section). Furthermore, we tend to save evidence during this stage (as we did in the prep stage) so we can compare if something trial was modified and if so, warn the user about it.

postremove

The postremove stage is just there in case some software bundles must be removed again to avoid conflicts. Usually, this stage is empty.

configure

The configure stage is used to setup cron entries, user permission or whatever you can think of.

postexecute

The postexecute stage is used to execute some program, such as cfg2html to grab a new base point of the system. Again, you can run other programs as well such as HPSIM-HealthCheck.sh and so on

Every time you enter or leave a stage the /var/opt/upgrade-ux/status gets updated with a timestamp and the stage name with an additional notification of start or ended. Upgrade-ux will not delete this status file, but will always append to it so you get a nice historic view of all the runs.

7. The upgrade-ux scripts

The scripts that are sourced by the main script upgrade-ux reside under /opt/upgrade-ux/scripts/ directory and the easiest way to know what will be sourced is by running /opt/upgrade-ux/bin/upgrade-ux -s:

$ sudo /opt/upgrade-ux/bin/upgrade-ux -s
upgrade-ux 1.27 / 24-Aug-2022
Using log file: /var/opt/upgrade-ux/log/upgrade-ux-20221128-1008-ITSGBHHLSP00741.log
Source init/default/02_print_host_info.sh
Source init/default/03_parse_variables.sh
Source init/default/03_prepare_tmp_build_area.sh
Source init/default/04_create_var_dir.sh
Source init/default/05_select_ini_file.sh
Source init/default/08_set_preview_var.sh
Source init/default/10_check_current_status.sh
Source init/GNU/Linux/10_define_hostname.sh
Source init/default/12_upgrade_allowed.sh
Source init/default/15_check_preview_run.sh
Source init/GNU/Linux/40_set_docker_var.sh
Source init/default/85_set_current_state.sh
Source init/default/90_show_current_state.sh
Source prep/default/05_reboot_required.sh
Source prep/default/05_source_cmcluster_conf.sh
Source prep/default/10_check_current_status.sh
Source prep/default/16_check_dp_backup.sh
Source prep/default/16_check_nbu_backup.sh
Source prep/default/16_check_nsr_backup.sh
Source prep/default/16_check_tsm_backup.sh
Source prep/default/17_list_nbu_backup_status.sh
Source prep/GNU/Linux/20_wait_on_chef_client_completion.sh
Source prep/GNU/Linux/27_save_grub_menu.sh
Source prep/GNU/Linux/28_save_system_release.sh
Source prep/GNU/Linux/29_save_kernel_version.sh
Source prep/default/30_save_pam_conf.sh
Source prep/GNU/Linux/30_save_rpm_qa.sh
Source prep/default/31_save_env_output.sh
Source prep/GNU/Linux/35_check_rear_image.sh
Source prep/default/35_save_mount_output.sh
Source prep/GNU/Linux/36_check_virusscanner_linuxshield.sh
Source prep/GNU/Linux/37_check_diskspace_requirements.sh
Source prep/GNU/Linux/38_save_satellite_info.sh
Source prep/GNU/Linux/39_save_yum_history.sh
Source prep/GNU/Linux/39_save_yum_log.sh
Source prep/GNU/Linux/40_disabling_local_repos_with_satellite.sh
Source prep/GNU/Linux/41_disable_rhn_satellite_subscription.sh
Source prep/GNU/Linux/42_archive_yum_repos_dir.sh
Source prep/GNU/Linux/43_save_yum_enable_status.sh
Source prep/GNU/Linux/49_yum_repolist.sh
Source prep/GNU/Linux/50_save_default_runlevel.sh
Source prep/GNU/Linux/54_check_on_hanging_rpm_cmds.sh
Source prep/GNU/Linux/55_verify_rpm_packages.sh
Source prep/GNU/Linux/60_save_knife_node_output.sh
Source prep/default/61_exclude_software_packages.sh
Source prep/GNU/Linux/61_save_extend_filesystem_features.sh
Source prep/default/62_sg_autostart_cmcld.sh
Source prep/default/70_check_openssl_logjam.sh
Source prep/default/72_save_uvscan_exclude_list.sh
Source prep/default/95_check_missing_programs.sh
Source prep/default/99_update_status.sh
Source preremove/default/01_enter_stage_acceptable.sh
Source preremove/default/05_read_section_from_inifile.sh
Source preremove/default/99_update_status.sh
Source preinstall/default/01_enter_stage_acceptable.sh
Source preinstall/default/05_read_section_from_inifile.sh
Source preinstall/GNU/Linux/06_yum_clean_all.sh
Source preinstall/GNU/Linux/07_journalctl_flush.sh
Source preinstall/GNU/Linux/08_clear_yum_cache.sh
Source preinstall/GNU/Linux/09_import_rpm_gpg_keys.sh
Source preinstall/GNU/Linux/10_stop_ds_agent.sh
Source preinstall/GNU/Linux/10_stop_nails.sh
Source preinstall/GNU/Linux/20_stop_cron.sh
Source preinstall/default/22_shutdown_opcagt.sh
Source preinstall/GNU/Linux/25_stop_tidal.sh
Source preinstall/GNU/Linux/26_stop_ctmagent.sh
Source preinstall/GNU/Linux/28_stop_docker.sh
Source preinstall/GNU/Linux/30_disable_chef_client_in_crontab.sh
Source preinstall/default/30_shutdown_quest.sh
Source preinstall/GNU/Linux/32_stop_tanium.sh
Source preinstall/GNU/Linux/33_stop_fluentbit.sh
Source preinstall/GNU/Linux/34_stop_flexera.sh
Source preinstall/GNU/Linux/35_stop_cisco_amp.sh
Source preinstall/default/80_run_cmds_defined_in_ini.sh
Source preinstall/default/99_update_status.sh
Source install/default/01_enter_stage_acceptable.sh
Source install/default/05_read_section_from_inifile.sh
Source install/default/20_sw_installation_in_progress.sh
Source install/GNU/Linux/29_exclude_packages.sh
Source install/GNU/Linux/30_install_software.sh
Source install/default/99_update_status.sh
Source postinstall/default/01_enter_stage_acceptable.sh
Source postinstall/default/05_read_section_from_inifile.sh
Source postinstall/default/10_save_dmesg.sh
Source postinstall/GNU/Linux/28_save_and_diff_system_release.sh
Source postinstall/GNU/Linux/29_save_and_diff_kernel_version.sh
Source postinstall/default/30_diff_pam_conf.sh
Source postinstall/GNU/Linux/30_save_rpm_qa.sh
Source postinstall/default/35_save_mount_output.sh
Source postinstall/GNU/Linux/39_save_and_diff_yum_log.sh
Source postinstall/GNU/Linux/40_needs_restarting.sh
Source postinstall/GNU/Linux/61_save_and_diff_extend_filesystem_features.sh
Source postinstall/default/99_update_status.sh
Source postremove/default/01_enter_stage_acceptable.sh
Source postremove/default/05_read_section_from_inifile.sh
Source postremove/default/99_update_status.sh
Source configure/default/01_enter_stage_acceptable.sh
Source configure/default/05_read_section_from_inifile.sh
Source configure/default/10_configure_commands.sh
Source configure/GNU/Linux/20_uncomment_cfg2html_in_crontab.sh
Source configure/default/26_fix_openssl_logjam.sh
Source configure/default/55_fix_uvscan_exclude_list.sh
Source configure/default/62_verify_sg_autostart_cmcld.sh
Source configure/default/99_update_status.sh
Source postexecute/default/01_enter_stage_acceptable.sh
Source postexecute/default/05_read_section_from_inifile.sh
Source postexecute/GNU/Linux/20_start_ds_agent.sh
Source postexecute/GNU/Linux/20_start_nails.sh
Source postexecute/GNU/Linux/25_start_crond.sh
Source postexecute/GNU/Linux/25_start_ntpd.sh
Source postexecute/GNU/Linux/25_start_tidal.sh
Source postexecute/GNU/Linux/26_start_ctmagent.sh
Source postexecute/GNU/Linux/28_start_docker.sh
Source postexecute/GNU/Linux/29_start_tanium.sh
Source postexecute/GNU/Linux/30_start_fluentbit.sh
Source postexecute/GNU/Linux/31_start_flexera.sh
Source postexecute/GNU/Linux/33_restart_apache.sh
Source postexecute/default/37_start_opcagt.sh
Source postexecute/default/38_start_quest.sh
Source postexecute/GNU/Linux/40_enabling_local_repos_with_satellite.sh
Source postexecute/GNU/Linux/43_restore_yum_enable_status.sh
Source postexecute/GNU/Linux/44_enable_on_rhel_yum_repos.sh
Source postexecute/GNU/Linux/45_enable_rhn_satellite_subscription.sh
Source postexecute/default/50_adapt_sg_autostart_cmcld.sh
Source postexecute/GNU/Linux/60_save_knife_node_output.sh
Source postexecute/GNU/Linux/60_save_satellite_info.sh
Source postexecute/GNU/Linux/65_remove_duplicate_packages.sh
Source postexecute/GNU/Linux/70_define_default_runlevel.sh
Source postexecute/default/80_run_cmds_defined_in_ini.sh
Source postexecute/GNU/Linux/80_run_grub2_mkconfig.sh
Source postexecute/GNU/Linux/82_enable_chef_client_in_crontab.sh
Source postexecute/GNU/Linux/85_update_major_release_in_config.sh
Source postexecute/GNU/Linux/95_reboot_required.sh
Source postexecute/default/96_call_for_action_after_preview.sh
Source postexecute/default/99_update_status.sh
Source cleanup/default/05_read_section_from_inifile.sh
Source cleanup/default/10_rm_old_cfg2html_reports.sh
Source cleanup/default/20_rm_sap_db_tmp_file.sh
Source cleanup/default/90_preview_ended_successfully.sh
Source cleanup/default/95_show_logfile_location.sh
Note
It depends on the OS architecture (see dump workflow) which scripts will be sources. In above example it was on HP hardware.

In every stage directory you will find minimum a default directory which is sourced by every OS and a hardware specific directory, such as:

  • hp

  • GNU/Linux

  • sunos

  • aix

The scripts found under these directories are only sourced when you run upgrade-ux on those HW architectures (make sense, no?). If you need new scripts just write a small script called my_script.sh (the .sh is important!) and it will be picked up the next time automatically.

Note
there is no need to make these small scripts executable (nor is it required to start with #!/bin/sh or whatever).

An example of such a script is /opt/upgrade-ux/scripts/preinstall/default/05_reboot_required.sh

Now it is up to you! If you wish to add new scripts it is always useful to first make a new issue at GitHub: https://github.com/gdha/upgrade-ux/issues

8. Frequently Asked Questions

8.1. Upgrade-ux not found

If you get the following error when you try to run upgrade-ux

The reason is that the absolute path /opt/upgrade-ux/bin is not added the the PATH variable. This is done on purpose to avoid mistakes! Therefore, always use the full path /opt/upgrade-ux/bin/upgrade-ux

8.2. Why upgrade-ux as we know update-ux

This question is only valid for HP-UX 11i systems which can be upgraded to a newer version of the Operation System (say HP-UX 11.23 to HP-UX 11.31), or even using update-ux to upgrade software bundles on the same OS version. We have encountered situations where the UNIX engineer by accident started update-ux on HP-UX 11.23 to patch with HP-UX 11.23 bundles, but using the HP-UX 11.31 depot, and therefore, update-ux started the upgrade process to HP-UX 11.31. As a result we needed to recover from an Ignite/UX image before restarting the patching round again. By using upgrade-ux this simply becomes impossible as all update paths are described in the configuration files.

8.3. How do we install a patch bundle from 1 or 2 years ago?

The YEAR variable defines the current year ( $(date +%Y) ) of the patch bundles in the /etc/opt/upgrade-ux/default.conf file. However, suppose we are in the year 2015 and still would like to install the patch bundle of 2014? The easiest way is to overrule the YEAR variable in the /etc/opt/upgrade-ux/local.conf as

8.4. How gets the SDSERVER variable defined

You might wonder how we define the SDSERVER? And, is it possible to overrule it with your preference? The SDSERVER variable is used a lot in the INI files and points to an IP address or FQDN of an software depot server where the software depots are stored.

The SDSERVER variable is defined by a script scripts/init/hp/30_define_sdserver.sh and tries to figure out the region you are located in. Be aware, this script only works well for one particular customer (the sponsor of this project).

Therefore, for other users, you need to define the SDSERVER variable in the /etc/opt/upgrade-ux/local.conf file as

Obviously, you need to replace the name my_sdserver.company.com with the correct name of the software depot server.

8.5. Upgrade-ux forces me to reboot the server if system is running for more then 30 days

The forced reboot was introduced into upgrade-ux, because sometimes servers got patches after running over 1 year without a single reboot and to avoid pin-points to bad patch bundles we decided a recent reboot was required (by default 30 days uptime is the maximum we tolerate).

However, in rare cases, some customers want to extend this period to 60 days. So, how to do this?

The variable which defines the uptime is called DAYSUPTIME and is defined in /etc/opt/upgrade-ux/default.conf. As you should know by now, you can overrule this by defining a new value in the /etc/opt/upgrade-ux/local.conf file as

However, be aware, if you increase this value then do not file an issue against upgrade-ux!