Difference between revisions of "Os4x oftp2 offlinehandling"

From OS4X
Jump to navigation Jump to search
Line 19: Line 19:
  
 
The configuration switch [[OS4X Core configuration#remove successfully handled offline OFTP2 file entries|remove successfully handled offline OFTP2 file entries]] influences the daemon how to handle the lines of the database table when the file is handled successfully.
 
The configuration switch [[OS4X Core configuration#remove successfully handled offline OFTP2 file entries|remove successfully handled offline OFTP2 file entries]] influences the daemon how to handle the lines of the database table when the file is handled successfully.
 +
 +
== Behaviour ==
 +
The main behaviour is as follows:
 +
#check database table for new entry ('<code>status=0</code>')
 +
#if entry exists:
 +
##run pre-script
 +
###if pre-scripts return with error abort
 +
###if not, continue
 +
##handle file
 +
##run post-script with returncode of handling
 +
#check for next entry
 +
#if no entry exists, sleep for defined timeslice
 +
 +
So, the following return code states are:
 +
 +
=== pre-script returncode handling ===
 +
If the returncode of the pre-script is not 0, further handling will not occur. The error (command call, returncode & output) will be logged in the receive log. The status of the entry will be set to "<code>2</code>".
 +
 +
If the returncode is zero, handling continues.
 +
 +
=== post-script returncode handling ===
 +
If the returncode of the post-script is not 0, the error (command call, returncode & output) will be logged in the receive log. The status of the entry will be set to "<code>6</code>". The entry will not be removed from the table.
 +
 +
If the returncode is zero, the configuration flag [[OS4X Core configuration#remove successfully handled offline OFTP2 file entries]] influences the next behaviour. If enabled (non-zero), the entry will be removed, otherwise it will be set to "<code>7</code>".

Revision as of 08:47, 4 December 2007

What is it?

"os4x_oftp2_offlinehandling" is a daemon which runs on a seperate machine, without needing an OS4X license. It needs an OS4X configuration file (default: "/etc/os4x.conf") in order to access the database, containing the OS4X configuration and parameters.

When the configuration flag " Enable offline handling of OFTP2 transfered files?" is enabled, all received files via OFTP2 will be added to a special table. This table, filled with all file parameters, will be traversed by the daemon. The main task is to handle (decrypt, decompress and/or check signature) the incoming files asynchronously on another machine, achieving the highest security.

parameters

There are several ways to customize the behaviour of this daemon. Please have a look at the configuration settings with all subsections [[OS4X Core configuration#Enable offline handling of OFTP2_transfered files.3F|here]].

scripts

There are two script, which get executed when accessible. These scripts have the following parameters:

pre-script

  1. real filename
  2. server ID

post-script

  1. real filename
  2. server ID
  3. returncode of OFTP2 handling process (0=no error)

The configuration switch remove successfully handled offline OFTP2 file entries influences the daemon how to handle the lines of the database table when the file is handled successfully.

Behaviour

The main behaviour is as follows:

  1. check database table for new entry ('status=0')
  2. if entry exists:
    1. run pre-script
      1. if pre-scripts return with error abort
      2. if not, continue
    2. handle file
    3. run post-script with returncode of handling
  3. check for next entry
  4. if no entry exists, sleep for defined timeslice

So, the following return code states are:

pre-script returncode handling

If the returncode of the pre-script is not 0, further handling will not occur. The error (command call, returncode & output) will be logged in the receive log. The status of the entry will be set to "2".

If the returncode is zero, handling continues.

post-script returncode handling

If the returncode of the post-script is not 0, the error (command call, returncode & output) will be logged in the receive log. The status of the entry will be set to "6". The entry will not be removed from the table.

If the returncode is zero, the configuration flag OS4X Core configuration#remove successfully handled offline OFTP2 file entries influences the next behaviour. If enabled (non-zero), the entry will be removed, otherwise it will be set to "7".