Use ePages Hotfixes 6.17.41
Created: 6.14.3; Updated: 6.17.5

Table of Contents

1 Prerequisites

Each ePages version has its own hotfixes, say version 6.14.2 may have the hotfixes 6.14.2.1, 6.14.2.2 and 6.14.2.3. Each hotfix is based on the previous hotfix (but hotfix number 1); you can install hotfix 6.14.2.3 only if you installed 6.14.2.2 before (and ePages version is 6.14.2). Linux tools as yum or zypper (as described below) resolve such dependencies automatically.

Before installing a hofix you may read on web page http://www.epages.com/hotfix/VERSION/ what hotfixes for your version are available and what fixed bugs they include (where VERSION is your ePages version, e.g. http://www.epages.com/hotfix/6.14.2/ ).

1.1 Customized Store Types

If you use customized storetypes that have own cartridges (other than cartridges for storetype Store, as defined in $EPAGES/Cartridges/Cartridges.xml) then those storetypes must be reinstalled.

For Flex installations, neither [EPAGES_CUSTOM_STORETYPES] nor [reinstall_storetype] are relevant.

For Multistore installations, only [reinstall_storetype] is relevant, then run:

  make reinstall_storetype STORE_TYPE=Master
  make reinstall_storetype STORE_TYPE=Multistore

1.1.1 EPAGES_CUSTOM_STORETYPES

If hotfix contains file Install/78-ReinstallCustomStoreTypes-shared.PL, you may set environment variable EPAGES_CUSTOM_STORETYPES to your customized storetypes, e.g.:

  export EPAGES_CUSTOM_STORETYPES="MyStoreType MyOtherStoreType"

Put this line into /etc/default/epages6, then you don't need to set it always in the command line before installing a hotfix.

1.1.2 reinstall_storetype

If hotfix does not contain file Install/78-ReinstallCustomStoreTypes-shared.PL, run reinstall_storetype for each customized storetype after hotfix installation, example:

  . /etc/default/epages6
  cd $EPAGES_CARTRIDGES/DE_EPAGES
  $PERL Makefile.PL
  make reinstall_storetype STORE_TYPE=MyStoreType
  make reinstall_storetype STORE_TYPE=MyOtherStoreType

2 Backup and Downtime

A hotfix neither manages backup/restore nor downtime. It is strongly recommended that:

  1. a database/file backup is made before installing the hotfix,
  2. the shop(s) are closed to outside while installing the hotfix.
A typical hotfix installation won't last longer than 1 to 10 minutes. Within this time your shops should be closed to outside connections. With Linux, close your shops to outside by running:

  /etc/init.d/epages6 start_httpd close

After the installation open your shops by executing:

  /etc/init.d/epages6 start_httpd open

This works only if you configured $EPAGES_CONFIG/WebInterface.conf properly, see Update Configuration to Restrict Outside Connections.

3 Use ePages Hotfixes on Linux

3.1 Enable Installation of ePages Hotfixes

For Flex stores with ePages version 6.14.3 or higher, the installation of ePages hotfixes is enabled automatically:

Run following command to check if ePages hotfixes are already enabled:

  rpm -q epages-hotfix-base

If the installation of ePages hotfixes is not enabled yet, run following command:

  rpm -hiv http://epages-software.de/RPMS/epages-hotfix-base.noarch.rpm

The installation of the RPM package epages-hotfix-base is executed only once. After that you may install ePages hotfixes manually or automatically as a cronjob.

3.2 Installation of ePages Hotfixes

The installed RPM package provides you with:

  1. the hotfix repository /etc/yum.repos.d/epages-hotfix.repo which is used to install new hotfixes and
  2. the script /etc/cron.daily/epages-hotfix which installs new hotfixes via cronjob automatically at night (can also be used manually on console)
→1 The ePages hotfix repository /etc/yum.repos.d/epages-hotfix.repo points to the repository for the installed ePages version. A patch that updates the ePages version also updates the version number in the hotfix repository by executing the Perl script /var/epages/UpdateHotfixRepo.PL.

→2 Automatic or manual installation of ePages hotfixes is executed by the script /etc/cron.daily/epages-hotfix (REDHAT means Redhat or CentOS):

  # /etc/cron.daily/epages-hotfix -help
  Check if new hotfixes are available:
    /etc/cron.daily/epages-hotfix -check
  REDHAT ONLY: If new hotfixes are available, download them (do not install):
    /etc/cron.daily/epages-hotfix -download
  REDHAT ONLY: Install new hotfixes and show the output on the console:
    /etc/cron.daily/epages-hotfix -console
  REDHAT ONLY: Install new hotfixes silently, send an e-mail (used by cronjob):
    /etc/cron.daily/epages-hotfix
  The script gets configuration values from (see there):
    /etc/sysconfig/epages-hotfix

Following command just checks for new hotfixes (does not install):

  # /etc/cron.daily/epages-hotfix -check
  New ePages hotfixes available for host: myhost.example.com:
  ==============================================================================
  Package                                 Arch        Version     Repository
  ==============================================================================
  epages-hotfix-6_14_2_3                  noarch      1-0         epages-hotfix

3.2.1 Manual Installation of ePages Hotfixes on Redhat/CentOS

Following command installs all new hotfixes for your ePages version (output incomplete):

  # /etc/cron.daily/epages-hotfix -console
  ...
  =========================================================================================
  Package                                 Arch        Version     Repository         Size
  =========================================================================================
  Installing:
  epages-hotfix-6_14_2_3                  noarch      1-0         epages-hotfix      297 k
  Installing for dependencies:
  epages-hotfix-6_14_2_1                  noarch      1-0         epages-hotfix      903 k
  epages-hotfix-6_14_2_2                  noarch      1-0         epages-hotfix      141 k
  Transaction Summary
  =========================================================================================
  Install      3 Package(s)         
  Update       0 Package(s)         
  Remove       0 Package(s)         
  ...

You also may install single hotfixes by excuting yum directly:

  yum --disablerepo '*' --enablerepo epages-hotfix install epages-hotfix-6_14_2_3

3.2.2 Hotfix Installation by Cronjob on Redhat/CentOS

If the RPM package epages-hotfix-base is installed on RedHat/CentOS, /etc/cron.daily/epages-hotfix is executed each night, time depends on /etc/crontab. On my host the cronjob is executed 4:02 A.M.:

  # grep cron.daily /etc/crontab
  02 4 * * * root run-parts /etc/cron.daily

The init script /etc/init.d/epages-hotfix stops (or starts) the execution of /etc/cron.daily/epages-hotfix by cron:

  # /etc/init.d/epages-hotfix stop
  Disabling nightly yum update:                              [  OK  ]
  # /etc/init.d/epages-hotfix status
  Nightly update of ePages hotfixes is disabled.
  # /etc/init.d/epages-hotfix start
  Enabling nightly yum update:                               [  OK  ]
  # /etc/init.d/epages-hotfix status
  Nightly update of ePages hotfixes is enabled.

The init script is started with each reboot:

  # chkconfig --list epages-hotfix
  epages-hotfix  	0:off	1:off	2:off	3:on	4:off	5:on	6:off

If you do not want to start /etc/init.d/epages-hotfix at boot time, disable it:

  # chkconfig --del epages-hotfix

In the configuration file /etc/sysconfig/epages-hotfix you may define on what days of the week you want to run /etc/cron.daily/epages-hotfix by cron, simply adjust the value of DAYS_OF_WEEK=0123456 (default: each day) to your needs.

3.2.2.1 Interference Between Patch and Hotfix Installation

Patch and hotfix installation shall not be executed at once.

Therefore, /etc/init.d/epages-hotfix is used in ePages patches: the patch begins with /etc/init.d/epages-hotfix stop and ends with /etc/init.d/epages-hotfix start.

If a patch is installed with yum, it waits until a perhaps running hotfix installation has finished. If you install a patch package as .tag.gz under Linux (you should not!) make sure that no hotfix installation runs (execute /etc/init.d/epages-hotfix stop/start manually and wait until the hotfix installation has finished).

3.3 Configuration of ePages Hotfix Installation

The hotfix installation script /etc/cron.daily/epages-hotfix is configured by /etc/sysconfig/epages-hotfix:

  # Pass any given parameter to yum, as run in all the scripts invoked by
  # this package. Be aware that this is global, and yum is invoked in
  # several modes by these scripts for which your own parameter might not
  # be appropriate.
  YUM_PARAMETER="--disablerepo '*' --enablerepo epages-hotfix"

  # Don't install, just check (everything else than 'yes' is 'no').
  CHECK_ONLY=no

  # Don't install, just check and download (everything else than 'yes' is
  # 'no').
  DOWNLOAD_ONLY=no

  # RANDOMWAIT is used to wait random time before the yum update starts.
  # Default is 60 so yum waits random time from 1 to 60 minutes. RANDOMWAIT
  # is used only when executed as cronjob, on console yum doesn't wait.
  RANDOMWAIT=10

  # If MAILTO is set and the mail command is available, the mail command is
  # used to deliver yum output. By default MAILTO is unset, so crond mails
  # the output by itself (example: MAILTO=root).
  MAILTO=

  # You may set SYSTEMNAME if you want your yum emails tagged differently.
  # Default is output of hostname command, this variable is used only if
  # MAILTO is set too.
  #SYSTEMNAME=

  # You may set DAYS_OF_WEEK to the days of the week you want to run.
  # Default is every day.
  #DAYS_OF_WEEK=0123456

  # Set to yes to make the epages-hotfix service to wait for transactions
  # to complete.
  SERVICE_WAITS=yes

  # Set maximum time period (in seconds) for the epages-hotfix service to
  # wait for transactions to complete. The default is 300 seconds (5 minutes).
  SERVICE_WAIT_TIME=3600

  # Init script lock file (don't change this).
  LOCK_SUBSYS=/var/lock/subsys/epages-hotfix

  # Cron script lock file (don't change this).
  LOCK_CRON=/var/lock/epages-hotfix.lock/pidfile

  # Yum transaction lock file (don't change this).
  LOCK_TS=/var/lock/epages-hotfix.lock/ts.lock

4 Hotfix Directory Structure

Hotfixes come in two flavours: RPM packages (as e.g. epages-hotfix-6_14_2_1-1-0.noarch.rpm) and tar.gz archives (as e.g. epages-hotfix-6.14.2.1.tar.gz). Both have the same content. The RPM package is unpacked into $EPAGES_SHARED/Patches, the tar.gz archive should be unpacked there as well.

Unpacking the package creates a directory with the hotfix name, e.g. $EPAGES_SHARED/Patches/epages-hotfix-6.14.2.1/ . The RPM package checks if the prerequisits are met; if not, the RPM package is not unpacked/installed.

After unpacking, perl install.PL is executed in the hotfix directory. If the RPM package should not start perl install.PL after unpacking, set and export the environment variable EPAGES_DO_PATCH on the command line, e.g.:

  export EPAGES_DO_PATCH=0

The hotfix directory in $EPAGES_SHARED/Patches contains following files:

install.txt
installation guide
fixed-bugs.txt
shows all solved issues with summary and description
fixed-files.txt
shows for each solved issue the involved files
filelist.txt
list of all files in the hotfix
version.txt
the hotfix version number
FileChanges
directory contains files that update ePages in general
StoreTypeChanges
directory contains files that update $EPAGES_WEBROOT/StoreTypes/
Install
Perl scripts that are used to install the hotfix (executed in alphabetical order)
epages-hotfix-NAME-install-`hostname`.log
log file for RPM installation
Backup-`hostname`
directory contains backups of replaced files
Backup-`hostname`.inexistent
file that contains files that were added by the hotfix
The hotfix version number is checked against a) the installed epages version and b) the already installed hotfix versions in $EPAGES_CONFIG/hotfix/`hostname`.txt. After successful installation version.txt in the hotfix directory is appended to $EPAGES_CONFIG/hotfix/version.txt and $EPAGES_CONFIG/hotfix/`hostname`.txt.

5 Hotfix Installation in Distributed ePages Linux Systems

Make sure to close all outside connections before installing the hotfix and to open them afterwards, see Backup and Downtime.

Hotfix installation in distributed systems requires the installation of the RPM package epages-hotfix-base on all servers, see Enable Installation of ePages Hotfixes.

Install the hotfix first on the alpha server (a server that runs application processes), then on all other servers.

After successful hotfix installation, execute final tasks on the alpha server:

  . /etc/default/epages6
  $PERL $EPAGES_PATCHES/HotfixPostInstall.PL

In a distributed installation the alpha host executes all Perl scripts in <hotfix></hotfix>/Install/ that not end in '-local.PL'; all other servers execute all Perl scripts that not end in '-shared/-final.PL'.

6 Troubleshooting: Force Re-Installation of ePages Hotfixes

If the hotfix fails on a single server or on the alpha server of a distributed installation, first remove line with hotfix version from $EPAGES_CONFIG/hotfixes/version.txt, e.g.:

  grep -v 6.14.3.8 $EPAGES_CONFIG/hotfixes/version.txt > o && cat o > $EPAGES_CONFIG/hotfixes/version.txt

Then, in any case, run:

  cd $EPAGES_PATCHES/epages-hotfix-*/
  . /etc/default/epages6
  $PERL Install/install.PL -nocheck


Copyright ePages GmbH 2016