ProFTPD module mod_counter



The mod_counter module is designed to allow a sort of "locking" to be enforced when the same file is being uploaded or downloaded by multiple clients at the same time.

mod_counter works by creating a semaphore

This module is contained in the mod_counter.c file for ProFTPD 1.2, and is not compiled by default. Installation instructions are discussed here.

The most current version of mod_counter can be found at:

  http://www.castaglia.org/proftpd/

Author

Please contact TJ Saunders <tj at castaglia.org> with any questions, concerns, or suggestions regarding this module.

Directives


CounterEngine

Syntax: CounterEngine on|off
Default: off
Context: server config, <VirtualHost>, <Global>
Module: mod_counter
Compatibility: 1.2.10rc1 and later

The CounterEngine directive enables or disables the module's runtime counter engine. If it is set to off this module does no "locking". Use this directive to disable the module instead of commenting out all mod_counter directives.


CounterFile

Syntax: CounterFile path
Default: None
Context: server config, <VirtualHost>, <Global> Module: mod_counter
Compatibility: 1.2.10rc1 and later

The CounterFile directive configures a file that mod_counter uses for tracking the semaphores it creates. This directive is required for mod_counter, if enabled, to function.


CounterLog

Syntax: CounterLog path|"none"
Default: None
Context: server config, <VirtualHost>, <Global>
Module: mod_counter
Compatibility: 1.2.10rc1 and later

The CounterLog directive is used to a specify a log file for mod_counter reporting and debugging, and can be done a per-server basis. The path parameter must be the full path to the file to use for logging. Note that this path must not be to a world-writeable directory and, unless AllowLogSymlinks is explicitly set to on (generally a bad idea), the path must not be a symbolic link.

If path is "none", no logging will be done at all; this setting can be used to override a CounterLog setting inherited from a <Global> context.


CounterMaxReaders

Syntax: CounterMaxReaders max
Default: 0
Context: server config, <VirtualHost>, <Global>, <Anonymous>, <Directory> Module: mod_counter
Compatibility: 1.2.10rc1 and later

The CounterMaxReaders directive specifies the maximum number of clients allowed to be reading to the same file at the same time. By default, all clients are allowed to read the same file at one time by mod_counter.


CounterMaxWriters

Syntax: CounterMaxWriters max
Default: 1
Context: server config, <VirtualHost>, <Global>, <Anonymous>, <Directory> Module: mod_counter
Compatibility: 1.2.10rc1 and later

The CounterMaxWriters directive specifies the maximum number of clients allowed to be writing to the same file at the same time. By default, only one client is allowed to write to the same file at one time by mod_counter.


Installation

To install mod_counter, copy the mod_counter.c file into
  proftpd-dir/contrib/
after unpacking the latest proftpd-1.2 source code. Then follow the usual steps for using third-party modules in proftpd:
  ./configure --with-modules=mod_counter
  make
  make install



Author: $Author: tj $
Last Updated: $Date: 2004/01/23 20:56:12 $


© Copyright 2004 TJ Saunders
All Rights Reserved