Operation

Overview
Startup
Logs
Maintenance
Backups


Overview

Operation of the server is very straight-forward. The configuration files determine the run-time parameters. Scripts are used to start and stop the various daemons. Errors are logged automatically.

There is some periodic maintenance that must be done and is covered in this section. Most of it can be set up to be executed automatically using crond and scripts.

Since this is a server, there is no client interface. Accessing the data is covered in a separate section named Client Access. While this may seem unusual, in the world of networking it is not. For example, the browser is a client interface to a web server. In fact, the example web interface to the data is one means of accessing the data in real-time. There are many other tools described the in Client Access section.

Section Contents


Startup

Scripts are supplied that support start, stop, restart and status arguments. The status argument also returns the build date for that particular daemon. If your distro supports 'chkconfig' that can be used to set the startup scripts (consult your distro's documentation for the utility if otherwise). At the command prompt, type:

chkconfig --add <script-name>

for each. The scripts use the same name as the daemon and are installed in the directory /etc/init.d. They are:

wxnhostd
wxnaprd
wxnqueryd

For example, to stop wxnhostd, type the following at a command prompt:

/etc/init.d/wxnhostd stop

The postgresql script is included with it's installation and will need to be enabled (the daemon does not start by default). This can be accomplished by typing the following at the command prompt:

chkconfig --level 35 postgresql on

All WXN server daemons support the '--verbose' option to get a diagnostic output. Extended diagnostic information is sent to the screen while running in this mode. To use this mode, use the appropriate script listed above to stop the daemon and then type the daemon name followed by the verbose argument at the command prompt. For example:

/etc/init.d/wxnhostd stop
wxnhostd --verbose
wxn host wx station daemon for Linux, version 0.1 (Jul 18 2004 @ 22:41:55)
Process ID: 20279

...

If started in the verbose mode, the server can only be stopped by using a system utility such as kill or killall. When a daemon starts in the verbose mode it will give the process ID (PID). This will be needed in order to stop the daemon. If you lose this, it can be obtained by doing the following as root:

[root@wxn root]# ps -xa | grep wxnhostd
23145 ? S 1:57 /usr/sbin/wxnhostd --verbose
6655 pts/2 S 0:00 grep wxnhostd
[root@wxn root]# kill 23145

You can check to see that the process was killed by entering the first line shown above again. Note that there are two entries shown for wxnhostd. This is because the ps utility reports all entries relating to wxnhostd. The first one is used. Note the '--verbose' argument.


Logs

Logs are written to the directory /var/log/wxn. They are as follows:

wxnhostd.log
wxnaprd.log
wxnqueryd.log
wxnsamed.log
(future)

If the install detected syslogd and the 'logrotate.conf' file, log rotations are automatic and follow Linux conventions.

Section Contents


Maintenance

The system is pretty much self-sustaining and only requires two routine maintenance tasks to be completed. Both have to do with the database and are as follows:

Experience has shown that a vacuum needs to be done daily, while the reindex only needs to be done once a week. The crond entries made during the installation satisfy this requirement. Symptoms of either is very slow access to table data.

The information supplied below is given in the event the scripts fail and/or you want to do it manually. What you type is shown in boldface.

[root@wxn root]# su - postgres
-bash-2.05b$ psql wxn
Welcome to psql 7.3.4, the PostgreSQL interactive terminal.
 
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit
 
wxn=# vacuum full;
VACUUM
wxn=# reindex table nodes;
REINDEX
wxn=# reindex table rcvtimes;
REINDEX
wxn=# \q
-bash-2.05b$ exit
logout
[root@wxn root]#

Section Contents


Backups

There are several different types of media than can be used for backups that range from Zip disks to tape drives. Probably the best alternative is using a CD writer due to the size of the database. Writers have become relatively cheap and so has the media. The scripts supplied with the server suite support using a CD writer. If you have a different media you wish to backup to, these scripts can still serve as a starting point.

All scripts are installed in runtime directory for PostgreSQL (usually /var/lib/pgsql). The scripts and their use are given in the table below. If you ran 'make install-bu' during installation, a crontab entry was made to run the backup once daily. If you want to change the defaults, you will need to modify the crontab for root.

Script Purpose
init-session Used to initialize the CD for multi-session writing. This must be done prior to making any backups. This means you will need to run this every time a new blank media is used. It must be executed as root from /var/lib/pgsql.
add-session This performs the backup and must be executed as root from /var/lib/pgsql. The script is called by the entry in crontab or can be done at the command prompt directly.
pg-session This script is called by add-session and must not be run directly.

Don't forget that if you execute init-session or add-session from the command prompt, you must put './' in front of the command. Therefore these two scripts would be executed like:

[root@wxn pgsql]# ./init-session

and

[root@wxn pgsql]# ./add-session

The init-session and add-session scripts may need to be modified to point to the correct device for backups. As written, they point to /media/cdrecorder. This is where the mount point is on Fedora Core. For most other distros, it will most likely be /mnt/cdrom.

Backup of the database is made using the PostgreSQL pg_dumpall utility. The files are created with a naming convention of yyyymmdd.dmp where yyyy is the four-digit year, mm is the two-digit month and dd is the two-digit day. Example:

20041117.dmp

This backup was made on 17 November 2004.

To restore the database, type the following shown in boldface. The example uses the file name in the previous example. Before the operation is carried out, the '.dmp' file must be copied to the /var/lib/pgsql directory or the complete path must be specified where the file is used below. In other words, you can use the CDROM, but you will have to specify the full path.

[root@wxn root]# su - postgres
-bash-2.05b$ psql -f 20041117.dmp template1
... (lots of output scrolls past on screen)
-bash-2.05b$ exit
logout
[root@wxn root]#

Section Contents