                     Documentation for FBBRENUM (XFBB)
                    by Stewart Wilkinson G0LGS Sysop GB7LGS
                    ---------------------------------------

COPYRIGHT

This software is Copyright (c) 2000 - 2005 by Stewart Wilkinson G0LGS.

Distribution and use of this software is permitted provided that all
copies retain the above copyright notice and the Warranty disclaimer below

WARRANTY

THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS' AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

IMPORTANT

Please ensure you read the whole of this document before using the
program, as failure to do so could leave you with an unusable XFBB system.

INTRODUCTION

This software is written for use with the Linux F6FBB BBS software V7.01
and later. (However it may also work with V7.00 see later).

FBBRENUM will renumber your messages, starting from a value which you
specify. The new starting number may be either higher or lower than the
existing value. However the normal use would be to 'reset' the numbers to
lower values.

The program updates DIRMES.SYS so that XFBB recognises the new numbers, it
also makes changes to INF.SYS so that users can continue to use the 'L'
command exactly as they did before the renumbering (each users ON base
value and Last Message values are adjusted), and to WFBID.SYS so that the
MID/BID History shown by the sysop 'FI' command remain valid.

Forwarding of messages should not be affected due to the changes made to
DIRMES.SYS.

XFBB will however use the new numbers as the basis for generating all new
Message ID's (MID/BID). It is therefore recommended that you DO NOT
renumber messages more often than necessary. (See OTHER CONSIDERATIONS)

PRECAUTIONS

As the software manipulates all the message files, DIRMES.SYS, INF.SYS and
WFBID.SYS, which are essential to the correct operation of XFBB, it is
highly recommended that you make and keep a safe backup all message files,
DIRMES.SYS, INF.SYS and WFBID.SYS before you attempt to renumber the
messages.

This will ensure that should the power fail or some other unforeseen event
occur during the few moments the program takes to do its work you should
be able to restore the system to normal operation.

As a further precaution to try and prevent corruption of the XFBB files,
once the renumbering process has started the program will silently ignore
the SIGINT (or CTRL-C) signals.

LIMITATIONS

FBBRENUM will not start the renumber process at numbers lower than 100 (as
this is the starting value for a new XFBB system), nor it will it renumber
the messages if it determines that the resultant highest message number
would be greater than 999,999.

Also the program will not renumber the messages if it determines that the
new message number range would overlap the existing number range.

USING THE PROGRAM

After closing XFBB and backing up the important FBB files (as detailed
above) you can simply start the program with a command line like:

	fbbrenum 1000

The program will attempt to check if FBB is currently active, it will
refuse to continue if it finds any active processes of 'xfbbd' or 'xfbb'.

Note: The program uses the linux program 'pidof' to perform this check, if
'pidof' is not available (on the current PATH) the program will exit with
the message 'Unable to determine if XFBB is active.'

The program will then read the information it requires from your fbb.conf
and perform some checks on DIRMES.SYS and the message files.

If the program determines that it cannot renumber the messages using the
base number supplied it will display a message giving some indication of
why and exit without making any changes to the messages.

Once it has done its checking the program will renumber the messages and
make the other necessary changes in the following sequence:

	1.  Renumbering of the messages in DIRMES.SYS
	2.  Renumbering the message files.
	3.  Adjusting user settings in INF.SYS
	3.  Adjusting MID/BID History in WFBID.SYS

Note: INF.SYS may be reduced in size as part of this process, as the
program carries out additional checks on this file (which includes
removing unused entries).

The original DIRMES.SYS will be saved as DIRMES.OLD, INF.SYS as INF.OLD
and WFBID.SYS as WFBID.OLD, these files should be removed manually when
you have confirmed that XFBB is working normally.

USING with XFBB V7.00

Whilst the program has not been tested with XFBB 7.00, I believe It should
work if you create a /etc/ax25/fbb.conf file with lines like:

	# Path to FBB mail folder
	messages = /var/xfbb/mail

	# Path to FBB compress mail folder
	compressed = /var/xfbb/binmail

	# Path to find DIRMES.SYS and INF.SYS
	data = /home/xfbb


OTHER CONSIDERATIONS

There are a few factors that you should consider before running the
program:

1. Although the program will do some tests to check that it will be able
to complete the process, you are advised not to pick a Base Number that is
close to existing values.

2. Choosing a number that is too close to existing range may lead to
problems with BID's. When changing the message numbers by a small value,
it is much more likely that another BBS will have remembered a previous
message using the same BID and so will reject a new one.

3. It is perhaps best to renumber the messages just before the existing
message numbers reach values that are multiples of 65536 (as this is the
point at which FBB software re-cycles BID's). ie: renumber them arond
65,000 or 130,000 etc and avoid renumbering them at numbers like 66,000 or
132,000 etc).

4. Any add-on program that keeps track of message numbers external to XFBB
will require you to manually reset the number it is using so that it will
work normally.

5. Always ensure that you close XFBB and backup the important files
(mentioned above) before you use the program.

ADDITIONAL FEATURES

The FBBRENUM program has a couple previously undocumented features, these
were originally included to help me when I was debuging the program. To
use these features create sym-links to the fbbrenum program like:

	ln -s fbbrenum listmsg
	ln -s fbbrenum listusr

(or simply copy fbbrenum as listusr and listmsg).

When run as listmsg or listusr the program opens DIRMES.SYS and/or INF.SYS
in read only mode and displays a full list of the current messages (in a
similar format to FBB's ML command) or a full list of the user information
(similar to FBB's DU command).

---
Stewart G0LGS
Sysop GB7LGS
