Changi NNTP Server 1.0

[ Bottom of Page | Previous Page | Next Page | Table of Contents ]

CHANCO.EXE
Control processor

Chanco is used to send messages to the control interface port of the Changi NNTP Server. When the server receives a control message, it performs the related action and returns a reply message.

Reply messages from the server contain human readable text with a blank separated return code in front. The return code is used by Chanco as its exit code.

The next chapters will cover the following topics:


Usage Examples

While starting Chanco from the command line, always use option -v to get a visible response. In batchfiles you should process the return code.


Sychronizing Internal Buffers and External Files

For fast access Changi keeps a bunch of newsgroup directories, overview files and the complete active file in memory. If, for example, new articles are added or expired articles are removed, Changi will not flush internal directory buffers. The main reason is that normally several articles get added or removed in one go and updating the buffers on each single change would cost extra processing time.

Changi will automatically flush its internal buffers 15 seconds after a client, who added new articles, disconnects and remains disconnected. In all other cases you may call

chanco -v flushlogs
to force buffer flushing.

Changi will also automatically update overview files when an updated group is accessed by a client for the first time. However, this may noticably degrade responsiveness of the server. Calling

chanco -v oversync normal
will start a background task on the server, which updates all overview files.

If your site is fed by a continuous pushfeed, you may make these calls automatically at fixed time periods, where flushlogs should be called more often than oversync.

Pitfalls

Getting new articles via Chanx from a remote server while leaving a local newsreader connected to the local newsserver may not automatically flush buffers after Chanx finished. This is because Changi will only perform a flush after all clients from a specific host are disconnect for at least 15 seconds, but the newsreader may keep a local host connection open.

The same is true after a newsreader, either local or remote, posted a new article. The new post will be seen only after all connections to the host running the newsreader had been closed.


Adding, Removing or Changing Newsgroups

Although you may add new newsgroups by editing the active file, calling
chanco -v newgroup local.company.rumors y boss@company.com
is the prefered way, because this will also maintain a file named active.times. The above example will add the new group local.company.rumors. The character y specifies that this group can receive local posts and the parameter boss@company.com specifies the creator, usually the mail address of the responsible person.

If you want to change the mode of this group from postable to moderated, use

chanco -v changegroup local.company.rumors m
To remove the group, simply call
chanco -v rmgroup local.company.rumors

Disable the Server

Some minutes before system shutdown, it's common to reject new connections but let clients with existing connections continue to finish their tasks.
chanco -v reject going down
causes the server to reject new connections with reason going down. Already established connections are continued. In order to allow incoming connections again, use
chanco -v allow going down
The reason must be equal to the one given in a previous reject command.

Prior to doing some reconfiguration like editing the active file, you should call

chanco -v flushserver under construction
which will flush the sever's internal active and history file buffers back to the disk and put the server into flushed state. As long as the server is left in this mode, neither the active nor the history files will be changed. Therefore the server is not able to insert incoming articles anymore, but will store them in a batchfile in directory CHANGISPOOLDIR\incoming. The name of the batchfile equals the name of the host sending the article.

Returning from flushed to normal mode is done by calling

chanco -v go under construction

For some specific tasks you may wish to completely disable the server without shutting down. In this case call

chanco -v flushserver shutup
immediately followed by
chanco -v pause shutup
which will flush all internal buffers and then freeze all connections. Note that no connections will be dropped or rejected during the paused state. They just hang. Only keep the server in this mode for a short time and call
chanco -v go shutup
as soon as possible to get it back to a normal state. Otherwise open connections may time out and get dropped on the client side.

Pitfalls

If you failed to check the successful completion of Chanco, it's very likely that you accidentally leave the server in an inoperable mode. If, for example, the server is in paused state and you mistyped the reason parameter with a Chanco go command, the server remains paused and clients are not able to continue with newsreading.


Changing Parameters on the Fly

Most parameters usually set via command line options could also be changed while the server is running. One use for this feature is to dynamically switch debugging flags on and off. Assume you've enabled user access control and one of your clients is unable to get connected.
chanco -v param d P1
will switch-on debugging of access permission control. This will have the same effect as calling Changi with option -dP. After having solved the problem you should call
chanco -v param d P0
to switch-off debugging.

You may also switch accessfiles based on the time of day. For example, at 8 o'clock in the morning you may call

chanco param a nntp_access.day
and at 9 o'clock in the evening
chanco param a nntp_access.night
to have different access permissions. Note that this will not touch existing connections, because access permission files are only checked while establishing a new client connection.

Query Lists

You may use Chanco to query a list of Each call of Chanco will return one item of the list. Call the program with an index parameter starting at zero and incremented by one on each subsequent call. The list of newsgroup may contain gaps, which are reported by Chanco with a return code of two, while the end of the list is indicated by a return code of one.

Example:

The following REXX script will query all active newsgroups and display them on the console:

/* List all active newsgroups */

DO i = 0
    '@chanco -v groupentry' i
    if rc \= 0 & rc \= 2 THEN
        LEAVE
END
Depending on your active file, this script will display something similar to
0 comp.os.os2.advocacy y
0 comp.os.os2.announce m
0 comp.os.os2.apps y
2 Go on
0 control y
0 control.cancel n
0 control.newgroup n
0 control.rmgroup n
0 junk y
1 not available

[ Top of Page | Previous Page | Next Page | Table of Contents ]


URL: changi/manual/chanco.html
Created: 3 August 1996
Revised: 2 December 1996
Author: harald@os2point.ping.de