Acquisition Workstation Installation – Linux
1  Background
1.1   Overview
An acquisition computer will typically have the following hardware and software installed:
w	Linux Operating System
w	Recommended patches for Linux
w	Java Runtime Environment (J2RE)
w	Recommended patches for J2RE
w	Chrysalis card reader and device driver
w	Nanometrics Software:
•	AutoDRM
•	Calibrate
•	DataServer
•	Nanometrics UI
•	NAQSClient
•	NAQSServer
•	NmxCLI
•	NmxToCD1 | NmxToCD11
•	NmxToCSS3
•	Playback
•	RM4Application
•	SMConsole
•	Nanometrics Libraries and General Utilities

1.2   Conventions
This document follows certain typographical conventions, outlined below:
w	Text file content is in bold text.
w	Command line entries are in Courier font.
w	All files, commands and file paths given in this document are examples only. Correct values were attempted, but you may have to find the right file and directory when copying or running files.
w	Actual IP addresses included in this document are taken from the standard Nanometrics Factory Acceptance Test setup. They will probably have to be changed when the final shipment/installation is made.
w	Any items enclosed in [ ] are descriptions of what should replace this item in the text, not including the brackets. Replace these items with the value to be configured.
1.3   Prerequisites
Hardware:
w	PC workstation
w	Minimum of 256MB RAM
w	Minimum of 40 GB system disk
w	LAN adapter, 10/100
w	Authentication card reader
Operating System:
w	Linux Fedora Core V1
Resources:
w	Linux installation kit
w	Nanometrics release CD
Personnel Qualifications:
w	Operators installing the system should be experienced with the Linux environment, Java development, Chrysalis tools, Xfree86 package and Nanometrics software.
2  Setup Instructions
2.1   Linux Operating System Installation
If Linux is not already installed on the computer:
1.	Make sure that the computer is set up to boot from the CD-ROM Drive.
2.	Place the first Linux installation CD into the CD-ROM Drive and boot the computer.
3.	Follow the instructions given by the installation program.
a)	Select graphical installation.

b)	Select Server installation.
c)	Select “Manual partition with Disk Druid”. Then remove all existing default partitions and create the following new partitions:

Mount Point	File System Type	Allowable Drives	Size	Size Options	
	swap	default selection	1020 MB	Fixed Size	
/	ext3	default selection	8000 MB	Fixed Size	
/var	ext3	default selection	2000 MB	Fixed Size	
/boot	ext3	default selection	102 MB	Fixed Size	
/nmx	ext3	default selection	remaining free space	Fixed Size	

d)	Install the following additional packages:
x X Windows System, and
x XFree86-Xnest
x XFree86-Xvfb
x GNOME Desktop environment, and
x gqview
x Mail Server, and
x imap
o unselect everything else
x Development
x rpm-build
x Kernel Development
e)	Enable FTP, Telnet, and SSH.
f)	Select eth0 to allow all traffic from a device.
g)	Install the default file system layout, using “ext3”.
Use the following questions/answers as a guide:
Main computer: ws01-ca01
IP address 10.17.224.2301
MTU: 400
Netmask: 255.255.0.0
Default Router: 10.17.224.1
Primary DNS: 193.218.117.161
Secondary DNS: 193.218.117.162
Domain Name: gci.ctbto.org
Monitor configuration: Unprobed monitor
Date and time: Enable network time protocol
4.	If the machine does not have an ethernet driver for Linux, install a new driver from the Nanometrics G drive or the manufacturer’s web site (e.g. INTEL pro EtherExpress /1000 gigabit (e1000) for an IBM InteliStation M Pro).
Otherwise:
4	Create an /nmx directory.

2.1.1    Installing Additional Packages
1.	Log in as root.
2.	Insert Fedora Core Disc 3 into the CD-ROM.
3.	Install the packages compat-gcc and compat-libstdc++: 
cd /mnt/cdrom/Fedora/RPMS
rpm –Uvh compat-gcc-7.3-2.96.118.i386
rpm –Uvh compat-libstdc++-7.3-2.96.118.i386
The version numbers provided in these commands reflect those in Fedora Core 1. Please check your disc for the correct file names if installing from a different Fedora Core version.
4.	When completed, eject the CD:
eject /mnt/cdrom
2.2   Copying Files from the Nanometrics Release CD
1.	Copy the releases.zip file from the Nanometrics release CD to /nmx:
cd /cdrom/<CD name>/
cp releases.zip /nmx/.
2.	Unzip the file: 
cd /nmx
unzip releases.zip
2.3   Installing the Java Runtime Environment
If Java j2re1.4.2_04 or later is not already installed on the computer:
1.	Log in as root.
2.	Create the Java directory in /nmx/releases:
cd /usr
mkdir java
cd java
3.	Install Java into this directory:
cp /nmx/releases/Linux/jdk1.4.2/j2re-1_4_2_04-linux-i586.bin .
chmod 777 j2re-1_4_2_04-linux-i586.bin
./j2re-1_4_2_04-linux-i586.bin
(run the file).
4.	Delete the installer:
rm j2re-1_4_2_04-linux-i586.bin
5.	Update the symbolic link to java:
cd /usr/bin
rm java
ln -s /usr/java/j2re1.4.2_04/bin/java java
6.	Reboot the computer.
reboot

2.4   System Configuration
2.4.1    Configuring User Accounts
1.	Log in as root.
2.	Select “System settings” from the task bar, then select “Users and Groups”. Modify the operator account. Create an “nmx” group and add the following user accounts to it:

User name	Password	Home directory	Shell	
nmx	nmxadmin	/home/nmx	/bin/bash	
autodrm	autodrm	/home/autodrm	/bin/bash	
operator	operator	/home/operator	/bin/bash	
3.	As root, add the following lines to /root/.bashrc:

export PATH=$PATH:/nmx/bin	
export LD_LIBRARY_PATH=/nmx/bin	
Add the above two lines to .bashrc in each user home directory (log in as the user, not root).
2.4.2    Configuring the Directory Structure
1.	Log in as root.
2.	Create the following directories on the /nmx partition:
mkdir /nmx/bin
mkdir /nmx/user
mkdir /nmx/log
mkdir /nmx/ringbuffer
3.	Give full access to user nmx to /nmx partition by running the following commands in the root directory:
cd /
chown -R nmx:nmx /nmx
chmod 770 nmx
2.4.3    Configuring IP Networking
1.	Log in as root.
2.	Use the System Tools / Internet Configuration Wizard. Select Ethernet Connection / Card / Statically Set IP Addresses:

Address	Mask	Gateway	
10.17.224.230	255.255.0.0	10.17.224.1	

2.4.4    Configuring the Time Service
1.	Log in as root.
2.	Go to the /etc directory.
3.	Open the ntp.conf file and change the following line:

server [IP address]	
where [IP address] should be replaced by the IP address of the selected time server(s), without the brackets. Note that there is a space between the word server and the IP address.
The time server should be an RM4 (if it has data flowing through it), a Cygnus, or EuropaT, etc. The more time servers specified, the better quality time the computer will have. Add an additional line for each time server, with the same format.
4.	Save the file.
5.	Right-click on the clock. Select “adjust time”, then select the correct time zone for it.
2.4.5    Configuring the Mail Service: Linux IPOP3
1.	Log in as root.
2.	Install the program:
a)	Check for loop back:
/etc/mail/sendmail.cf
Comment out the following line if it is there:
O DaemonPortOptions=Port=smtp.Addr=127.0.0.1, Name=MTA
b)	Restart the service:
/sbin/service sendmail restart
3.	Change the ipop3 file in services:
cd /etc/xinetd.d
Change the following line:
disable = no
Restart the daemon:
/sbin/service xinetd restart
Or
/etc/init.d/xinetd restart
2.4.6    Configuring the Linux Disk Usage Monitor
1.	Log in as root (su -).
2.	Install the diskcheck package:
cd /nmx/releases/Linux/Nanometrics/GenUtil/*/bin
rpm -Uvh diskcheck-1.4-5.noarch.rpm
3.	Modify the file:
/etc/diskcheck.conf
a)	Set defaultCutoff = 90
b)	Insert the following entries:
cutoff['/nmx'] = 90

cutoff['/var'] = 90
cutoff['/'] = 90
c)	Set mailTo = operator@host.gci.ctbto.org
 (where host is the name of the operator’s workstation)
2.5   Installing Internal Card Reader (PCMCIA) and Device Driver
1.	Ensure that the workstation is started with the card reader connected and powered.  The Token Card must be in the card reader at this point.
2.	Log in as root.
3.	Enable the PCMCIA service:
a)	RedHat icon > System Settings > Server Setting > Services.
b)	Check the pcmcia button.
c)	Select start (or restart).
4.	Copy the luna2IcardDriver.tgz file to  the root directory and untar the file:
cp nmx/releases/NmxFirmware/Luna2ICardDriverLinux/luna2ICardDriver.tgz /
cd /
tar –zxvf luna2ICardDriver.tgz
2.6   Installing Nanometrics Programs and Utilities
1.	Log in as root.
2.	Copy all files from the /nmx/releases/Linux/Nanometrics/..../bin directories to
/nmx/bin.
cd /nmx/releases/Linux/Nanometrics
(or where the list of Nanometrics software can be seen)
cp */*/bin/* /nmx/bin
cp */*/bin/.run* /nmx/bin
3.	Copy all files from the /nmx/releases/Linux/Nanometrics/..../user directories to
/nmx/user.
cp */*/user/* /nmx/user
4.	Copy all files from the /nmx/releases/Linux/Nanometrics/JavaLibExt directory to
/usr/java/j2re1.4.2_04/lib/ext/.
cd /nmx/releases/Linux/Nanometrics/JavaLibExt
cp */* /usr/java/j2re1.4.2_04/lib/ext
5.	Set ownership of all Nanometrics files to nmx.
cd /
chown -R nmx:nmx /nmx
6.	Set all files, except jar files, in /nmx/bin to executable.
cd /nmx/bin
chmod +x *
chmod +x .run*
chmod -x *jar
7.	Copy the nmxwatchdog file from the General Utilities software package to
/etc/init.d.
cp /nmx/bin/nmxwatchdog /etc/init.d
8.	Install the nmxwatchdog.

cd /etc/init.d
chkconfig --add nmxwatchdog
9.	Currently, the following services are being watched: naqs, dataserver, nmxtocd11, autodrm and nmxtocss3. Should other services need to be watched by the watchdog program, edit the /nmx/bin/nmxrun, /nmx/bin/nmxrun_primary and /nmx/bin/nmxrun_auxiliary files.
10.	Exit the root login (exit).
11.	In /nmx/bin, install the cron script that will erase log files older than 30 days and waveform data files that are older than 14 days on the computer every day. DO NOT RUN THIS COMMAND WHILE IN SUPER-USER MODE:
crontab /nmx/bin/nmxcron
12.	Go to /nmx/bin and copy RM4Application into new files called RM4_[SN], where [SN] is replaced by the serial number(s) of the RM4s being shipped with the system. Make one file for each RM4.
cp -p RM4Application RM4_76
13.	Edit each RM4_[SN] file to incorporate the IP address for the corresponding RM4. In the line

java -cp /nmx/bin/RM4Gui.jar RM4Show $1	
replace the $1 with the appropriate IP address (check with the systems group).
14.	Create icons on the desktop for the following programs:
Waveform
NaqsView
ConfigUI
RM4_[SN]
To do this, open the File Manager. Go to the /nmx/bin directory. Drag and drop the selected icons onto the desktop.
15.	Log out by clicking the EXIT button on the tool bar at the bottom.
16.	Log back in as nmx. This has now saved the icons into your workspace.
17.	Be sure that all of the icons work by testing every one of them.
2.6.1    Moving Linux Mail Directory
1.	Copy the existing mail folder (preserving all attributes) to /nmx:
cp -rp /var/spool/mail /nmx
2.	Rename the old mail directory:
mv /var/spool/mail /var/spool/mail.old
3.	Create a new symbolic mail link to /nmx/mail in /var/spool:
cd /var/spool
ln -s /nmx/mail mail	
4.	Change ownership of the link:
cd /var/spool
chown root:mail mail

2.7   Configuring the LUNA Token
1.	Insert the token into the card reader.
2.	Launch SMConsole.
3.	Select <2> Workstation / <2> Initialize Token.
4.	Respond yes, initialize the token.
5.	Set all pins to CTBTO, and leave the token title blank.
6.	Select <4> Login User, and enter the PIN.
7.	Select <6> Generate KeyPair
8.	Choose the default names for the keys.
9.	Select <11> Generate CertReq.
10.	Use the following guidelines for parameters in the certificate request:

Subject Name (CN):	[The computer name, for example ws01-JMIC]	
Organization (O):	CTBTO	
Organization Unit (OU):	IMS	
Locality (L):	[The 3-4 letter station code, for example JMIC]	
Country (C):	[not used—press carriage return]	
11.	Save the file in /nmx/user/[Computer Name].crq.
12.	Email this file to CTBTO, requesting the workstation certificate as well as the certificate of the Certificate Authority (CA) that issued the workstation certificate, in return.
13.	When the certificates are received, login as user again.
14.	Select <7> Load Certificate
15.	Load the CA certificate. It will probably be called cacert.pem.
16.	Select <7> Load Certificate
17.	Load the workstation certificate. It will probably be called [computer name].pem.
2.8   Configuring the Xfree86-xvfb package
This package is required only if this workstation is used to save jpeg files using the Calibrate command line interface.
Due to the security mechanism built in to Fedora Core V1, user needs to log in via ssh to the computer host (local or remote) before he or she can start using the calibrate command line interface.
Execute the command: ssh -X localhost -l nmx

Xvfb :1 -fp /usr/X11R6/lib/X11/fonts/misc &
4	To verify the proper setup of Xvfb, execute the following commands which should display the graphical clock:
xclock -display :1 &
xwd -display :1 -root | xwud

(Press q to close the graphical clock.)
2.9   Basic Configuration of Input Files for Nanometrics Software
There are 4 primary software applications used on Nanometrics data acquisition workstations:
w	NAQS Server – NAQS Server is a data acquisition system designed to receive, process, and store serial data, seismic data, and state-of-health information received from Nanometrics’ latest generation of data acquisition and communications equipment.
w	AutoDRM – AutoDRM is an Automatic Data Request Manager that allows users, via email, to request seismic data from, and send commands to, a Nanometrics data acquisition system.
w	NmxToCSS3 – This software converts the incoming waveform data to CSS3 format and stores them at the data acquisition workstation.
w	NmxToCD1 / NmxToCD11 – NmxToCD1 is designed to forward seismic data from a Nanometrics data acquisition system (NaqsServer) to an IDC data center, using the CD-1 data format and protocol defined in IDC 3.4.2 (May 1998). NmxToCD11 forwards time series data from a Nanometrics data acquisition system (NaqsServer) to an IDC data center, using the CD-1.1 data format and protocol defined in IDC 3.4.3 Rev. 2 (December 2001). It is important to note that NmxToCD1 and NmxToCD11 cannot be run at the same time. The data acquisition system must be configured for one or the other.
Basic configuration information for each application is provided in the following sections.
2.9.1    NAQS Server
The NaqsServer software is configured through the Naqs.ini and the Naqs.stn files. For more detailed information on how to configure NAQSServer, refer to the NAQSServer section of the Software Reference Manual. The NAQS Server manual provides comprehensive information on every configuration parameter. Below is the basic NaqsServer configuration information for CTBTO.
Naqs.ini:
w	Naqs log files should be located in /nmx/log/naqs

LogPath = /nmx/log/naqs	
w	Multicast group should be set to where the RM4s/Europas are sending to. Nanometrics default is 229.1.4.1

MulticastGroup = 229.1.4.1	
Naqs.stn:
w	The Network Name at the top of the Naqs.stn file should be set to the 3-4 letter Station Code provided by CTBTO. This is the same code as used in the NmxToCD1.ini file.

w	All SohBufferPaths should point to /nmx/ringbuffer in the InstrumentPrototype sections.

SohBufferPath = /nmx/ringbuffer	
w	SohChannelName in the InstrumentPrototype section should be as follows, for each instrument:

Europa	EUR		
RM-4	RM4		
Cygnus	CYG	(used in only some CTBTO systems)	
Carina	CAR	(used in only some CTBTO systems) 	
Trident	TR	(not used in most CTBTO systems)	
TimeServer	TSR	(not used in most CTBTO systems)	
w	All RingbufferPaths should point to /nmx/ringbuffer in the ChannelPrototype and SerialChannelPrototype sections.

RingBufferPath = /nmx/ringbuffer	
w	Ringbuffer sizes should be set so that the Seismic (Channel) ringbuffers are roughly 10-12 times the size of the Authentication (SerialChannel) ringbuffers, since authentication takes about 10-12 times less room than seismic data. For example, use 500MB and 50MB.
2.9.2    AutoDRM
The AutoDRM software is configured through the AutoDRM.ini file. For more detailed information on how to configure AutoDRM, refer to the AutoDRM section of the Software Reference Manual. The AutoDRM manual provides comprehensive information on every configuration parameter.
w	HostMailServer should be localhost.
w	MailDomain should be gci.ctbto.org.
w	StationCode should be set to the same 3-4 letter code used in Naqs.stn and NmxToCD1.ini.
w	Log, Request, and Response directories should be in /nmx/log/autodrm.
w	For Authentication parameters, use:

TokenID	= any	
PIN	= ctbto	
KeyID	= 1	
VerificationDepth	= 0	
w	From the /nmx/user directory, create the autodrm and the autodrm/scheduleItems subdirectories.
cd /nmx/user
mkdir autodrm
mkdir autodrm/scheduleItems
w	Copy the Calibration.ini from the user directory to the autodrm subdirectory
cp Calibration.ini autodrm/
w	Modify the autodrm/Calibration.ini to change the SchedDir entry to /nmx/user/autodrm/scheduleItems

w	Modify the AutoDRM.ini and change the following entries:
•	CalibrationFile to /nmx/user/autodrm/Calibration.ini
•	ScheduleDir to /nmx/user/autodrm/scheduleItems
Note	If you change the ScheduleDir in /nmx/user/AutoDRM.ini or SchedDir in /nmx/user/autodrm/Calibration.ini, you must change the autodrm watchdog script to use the new directories.

2.9.3    NmxToCSS3
The NmxToCSS3 software is configured through the NmxToCSS3.ini file. For more detailed information on how to configure NmxToCSS3, refer to the NmxToCSS3 section of the Software Reference Manual. The NmxToCSS3 manual provides comprehensive information on every configuration parameter.
w	The StationCode should be set to the 3-4 letter code provided by CTBTO.
w	Log file should be located in /nmx/log/nmxtocd1, and should be run in VERBOSE mode.

LogPath	= /nmx/log/nmxtocss3	
Verbosity	= VERBOSE	
w	For testing purposes, use the following parameters. Parameters not shown should be left as default.

NaqsAddress	= localhost	
NaqsPort	= 28000	
DataServerAddress	= localhost	
DataServerPort	= 28002	
DataServerUser	= ?	
DataServerPwd	= ?	
CalibrationAddress	= 230.0.0.2	
CalibrationPort	= 4501	
CalHistoryFile	= calHistory.cd1 or calHistory.cd11	
...		
w	Add entries for all instruments of interest.
Note	If you change the waveforms directory in the NmxToCSS3.ini file, you must change the nmxcron to use the new directory.

2.9.4    NmxToCD1
The NmxToCD1 software is configured through the NmxToCD1.ini file. For more detailed information on how to configure NmxToCD1, refer to the NmxToCD1 section of the Software Reference Manual. The NmxToCD1 manual provides comprehensive information on every configuration parameter.
w	The StationCode should be set to the 3-4 letter code provided by CTBTO that is registered with the CD1 Receiver.

w	Log file should be located in /nmx/log/nmxtocd1, and should be run in VERBOSE mode.

LogDirectory	= /nmx/log/nmxtocd1	
Verbosity	= VERBOSE	
w	For testing purposes, use the following parameters. Parameters not shown should be left as default.

IdcAddress	= 172.22.241.62		
IdcPort	= 7600		
...			
ReTxDelayMinutes	= 30, 120, 720 		
TxHistoryHours	= 336		
TxHistoryStart	= 2002-10-10 12:00:00	(set this to the current date/time)	
w	All ringbuffers should be located in /nmx/ringbuffer.
w	NmxChannelName and HdrChannelName should be the Ringbuffer file names of the relevant Seismic and Authentication channels. The IdcChannelName should have the same prefix, as shown in this example:

NmxChannelName	= STN01.BHZ	
IdcChannelName	= STN01/ch1	
HdrChannelName	= STN01.AUZ	
RbfDirectory	= /nmx/ringbuffer	
HdrDirectory	= /nmx/ringbuffer	
w	The Calibration Factor should be calculated based on the system sensitivity of the system, brought down into units of ground motion (nm/count). The Calibration period is almost always left as 1.
2.9.5    NmxToCD11
The NmxToCD11 software is configured through the NmxToCD11.ini file. For more detailed information on how to configure NmxToCD11, refer to the NmxToCD11 section of the Software Reference Manual. The NmxToCD11 manual provides comprehensive information on every configuration parameter.
w	For testing purposes, use the following parameters. Parameters not shown should be left as default.

NaqsAddress	= localhost	
NaqsPort	= 28000	
IdcAddress	= 172.22.241.63	
IdcPort	= 11000	
FrameCreator	= [station code]	
FrameDestination	= IDC	

w	The StationName should be set to the 3-4 letter code provided by CTBTO that is registered with the CD1.1 Receiver.

StationName	= [station name]	
StationType	= IMS	
w	The TxHistoryStart field is used to specify a date and time. NmxToCD11 will forward all data corresponding to a date and time subsequent to the date and time indicated in this field.

TxHistoryHours	=168		
TxHistoryStart	= 2002/11/15 12:00:00	(set this to the current date/time)	
w	The Log file should be located in /nmx/log/nmxtocd1l, and should be run in VERBOSE mode

LogDirectory	= /nmx/log/nmxtocd1	
Verbosity	= VERBOSE	
w	The NaqsRunDir field is used to specify the absolute path to the directory in which NAQS is running. This is the directory which contains the Naqs.stn configuration file.

NaqsRunDir	= /nmx/user	
w	List all the NAQS data channels to be built into the data frame using the dotted station-channel name.

STN01.BHZ	
STN01.BHN	
STN01.BHE	
STN02.SHZ