Open main menu
SUPPORT DOCUMENTATION

Upgrading NAMs avoiding RSYNC on the private network

If your NAM has a slow or intermittent network connection, there is a possibility of problems occurring during a firmware upgrade. In rare cases, the system can potentially become unusable when an upgrade takes a significantly long time or is interrupted. To guard against this, it is possible to download a mirror copy of the firmware onto the file-system of the NAM itself. It can then upgrade itself using this copy as the upgrade source. The process is essentially identical to using a local mirror site with the exception that it uses the device itself as its own mirror server.

The easiest way to do this is using rsync (see the Upgrading Platinum Systems With Unreliable Internet Connections page) but these instructions are specifically aimed at applications where rsync is to be avoided on the private network. Instead, tar and ssh are used to transfer a firmware image to the target NAM using a technique known as a tar-pipe. The source of the image to be transferred can be built using rsync or acquired directly from Güralp Systems on a USB stick.

The target NAM must have access to the network while the tarpipe is running but it does not need network access while it is actually upgrading. If the download process is interrupted, it can be easily restarted. The operation of the target NAM is not affected during the download (other than by creating a bandwidth requirement) so this process can safely be repeated until it has completed successfully.

Platinum systems use the rsync protocol to update their firmware to the latest revision. rsync is an extraordinarily flexible tool but it can be rather complex. The upgrade script on the NAM is a front-end to rsync which is used to hide this complexity and ensure the safe use of the protocol. The source for the rsync transfer is normally the Güralp rsync server; in this instance, it will be a local image in the target device's file-system: i.e. the device will function as its own mirror server. In this way, while the rsync protocol is still used, it is not used over the network.

Upgrading a NAM using itself as its own upgrade mirror involves five steps:

The procedure is slightly different for systems with different architectures so the instructions have been split into three. This page only covers MkⅡ NAMs. If you are attempting to upgrade a DM24SxEAM, a *TDE instrument or an Affinity, please select one of the links below:

The NAM MkⅡ is a rack-mounting unit occupying one unit of vertical space (44.5 millimetres or 1.75 inches), as shown below. If your NAM is larger than 1u, or does not match the image, please contact for advice.

Acquiring the mirror content

The mirror content must first be transferred to a Linux PC or server. (Windows file-systems do not support the necessary file attributes.) If the Linux server can be connected to the Internet, commands similar to those below can be used to acquire a copy of the firmware.

sudo adduser -a ptmirror sudo mkdir ~ptmirror/platinum-stable cd ~ptmirror/platinum-stable GSLSRC=rsync.guralp.com/platinum-stable/CMG-NAM-mk2 sudo rsync -EgHloprtv --exclude resolv.conf rsync://$GSLSRC .

If, instead, the image has been delivered on a USB stick, mount the stick on, say, /mnt and enter commands like these:

sudo adduser -a ptmirror MODULE=platinum-stable/CMG-NAM-mk2 sudo mkdir -p ~ptmirror/$MODULE cd ~ptmirror/$MODULE sudo rsync -EgHloprtv --exclude resolv.conf /mnt/$MODULE/ .

The server created in this step will be referred to as mirrorhost in the commands below. You should substitute the appropriate DNS name or IP address in each command where you encounter this.

Problems?

The most common problems experienced at this stage are:

rsync reports “Temporary failure in name resolution

If you see error messages like

rsync: getaddrinfo: rsync.guralp.com 873: Temporary failure in name resolution rsync error: error in socket IO (code 10) at clientserver.c(122) [receiver=3.0.2]

it means that the Domain Name Service (DNS) client is misconfigured. If you are running DHCP, this may be a problem with your DHCP server not providing the address of a nameserver (or providing an incorrect one). If you are using static addressing, check and correct the nameserver using the net-setup tool.

rsync reports “Network is unreachable

If you see error messages like

rsync: failed to connect to rsync.guralp.com: Network is unreachable (101) rsync error: error in socket IO (code 10) at clientserver.c(122) [receiver=3.0.2]

it means that the network routing is misconfigured. If you are running DHCP, this may be a problem with your DHCP server not providing a default route (or providing an incorrect one). If you are using static addressing, check and correct the default route using the net-setup tool.

rsync reports “rsync error

If you see error messages like

rsync error: received SIGINT, SIGTERM or SIGHUP (code 20) at rsync.c(541)

it means that, most probably, a firewall is blocking traffic on the rsync port. Ask your network administrator to permit the Linux PC to open TCP connections to host rsync.guralp.com on port 873.

Transferring the mirror content to the target NAM

It is essential to ensure that sufficient space is available before starting the transfer.

The mirror content occupies a significant amount of disk space, so it is important to check the available space before proceeding. To check the space available, log on to the command line of your target system and type the command

df -h

The output consists of a table with several lines of content, such as:

DemoNAM ~ # df -h Filesystem Size Used Available Use% Mounted on devtmpfs 497.8M 64.0K 497.7M 0% /dev /dev/sda4 239.9M 135.4M 87.8M 61% / devtmpfs 497.8M 64.0K 497.7M 0% /dev /dev/sda6 108.5G 584.5M 107.9G 1% /var tmpfs 500.2M 0 500.2M 0% /tmp tmpfs 500.2M 2.9M 497.3M 1% /run tmpfs 500.2M 0 500.2M 0% /var/empty tmpfs 500.2M 0 500.2M 0% /dev/shm /dev/sda5 58.0M 6.3M 47.2M 12% /var/log DemoNAM ~

Look for the row where the value in the Mounted on column contains /var, as highlighted in the example above, where the available space is 107.9 GB.

These systems require around 95 MB of free space to store the upgrade image. Only proceed if you have enough space.

The NAM MkⅡ typically has enough space to store firmware uprade images for several different architectures so it is possible to use a single NAM MkⅡ as an upgrade server or staging post for a whole network of different Platinum devices. Please contact for more information about this technique.

The firmware image is pushed from mirrorhost to the target NAM in tar format over an ssh pipe. If you do not have ssh keys set up, you will be prompted for a password: use the normal root password that you would use to log on to the command line of your NAM. If you have ssh keys configured, you should not be prompted.

From the command line of the mirrorhost, enter the following commands:

cd ~ptmirror/platinum-stable MDIR=/var/Pt-firmware-mirror.local/ tar c CMG-NAM-mk2/ | ssh root@targetNAM "mkdir $MDIR && cd $MDIR && tar xv"

Problems?

The most common problems experienced at this stage are:

ssh reports “Name or service not known

If you see error messages like

ssh: Could not resolve hostname example.com: Name or service not known lost connection

this means that the Domain Name Service (DNS) client is misconfigured or has not been told about your target NAM. The easiest solution is to use the target NAM's IP address in place of its hostname.

ssh reports “Network is unreachable

If you see error messages like

ssh: connect to host example.com port 22: Network is unreachable

this usually means that the networking on the target NAM is not configured properly: often the NAM is on the wrong logical network. If the NAM is intentionally on a different network to the mirrorhost, this error means that the network routing on mirrorhost is misconfigured. If you are running DHCP, this may be a problem with your DHCP server not providing a default route (or providing an incorrect one). If you are using static addressing, check and correct the default route using the net-setup tool on the target system or the ip route command on the mirrorhost.

ssh reports “Connection refused

If you see error messages like

ssh: connect to host example.com port 22: Connection refused

this means that the ssh server is not configured correctly on the target NAM. Review the server settings or contact for assistance.

Setting up the target NAM as an rsync server

The target NAM's rsync server is configured by creating the file /etc/rsyncd.conf using the following commands:

cat >/etc/rsyncd.conf <<EOF port = 873 [platinum-local-mirror] path = /var/Pt-firmware-mirror.local comment = Platinum firmware numeric ids = yes log file = /var/log/rsync.log timeout = 600 hosts allow = 127.0.0.0/8 uid = 0 gid = 0 EOF

Once the /etc/rsyncd.conf file is in place, you should start the rsync server with the command

rsync --daemon

Configuring the target NAM to use its local server

Create the file /etc/conf.d/upgrade.local using the following commands:

cat >/etc/conf.d/upgrade.local <<EOF RSYNC_HOST="127.0.0.1" RSYNC_PORT="873" RSYNC_MODULE="platinum-local-mirror" RSYNC_ADDITIONAL_OPTS="--no-delay-updates --delete-during" EOF

Perform the upgrade

The NAM can now be upgraded by using the upgrade command. Once the upgrade has completed successfully, the system should be rebooted, either by using the web interface or, from the command-line, with the command reboot

The upgrade will remove the /etc/rsyncd.conf file and the reboot will halt the rsync server so, if the upgrade is to be repeated for any reason, you will need to repeat the steps listed under Setting up the target NAM as an rsync server.

For more information, first contact your local distributor or email .