ipsynd (Sat Oct 25 2014 01:31:01)

ipsynd

IPSYND is the syndication daemon which is normally started as a local process
by the main IP system.

It continually checks the syndication contorl queue for new client
transmissions to start (flagged by a SYN_client record in spool/syn/control).

These would have been written by MUI user interface SYN or crontab or the Web
interface.

Once a record has been found, IPSYND opens the CLIENT parameter file for the
ROUTE to start the transmission on. It then checks the PORTS file in tables/syn
for a valid port to use. If this is NOT already in use by another
syndication/library client, IPSYND starts program IPSYN to do the dirty work.

Once started, IPSYND checks on progress. If IPSYN has failed completely or has
not managed to send all the files, IPSYND restarts it.

The Ports file which is in tables/syn, has the following syntax :
	; comment
	route:(routename)  host:(hostname/terminal server)  port:(port no) 
multi:(number) telnet:
where	route	is the name of a route file in tables/syn/route
	host	is the hostname of the terminal server port or network device
	port	is the port number on the terminal server
	multi	is (optional) number of simultaneous connections on the port
		multi defaults to one - and for terminals servers is generally
		all you can have.
	telnet	is (optional) telnet transparency OFF for this port.
	rawtelnet is (optional) use raw telnet (ie binary/no escapes) for this port.

These parameters are case insensitive in the PORTS file as filenames etc are
automatically forced Uppercase and hostnames lowercase.

A single port can be specified for several routes. However only one connection
will be allowed at any one time (unless 'multi' is also specified) :
	route:hayes12	host:svr3	port:1103
	route:hayes24	host:svr3	port:1103
	route:hayes96	host:svr3	port:1103

When there is more than one modem/port available for the same traffic, the
'route' is NOT unique :
	route:x25slow	host:bigpad	multi:7
	route:x25slow	host:lilpad
This will allow up to 8 simultaneous transmissions, 7 via 'bigpad' and another
via 'lilpad'.

The Client parameter file has the following syntax :
	; comment
	route:	name of the Routing file in tables/syn/route
	alt:	(optional) name of the Alternate Routing file in tables/syn/route
	timeout: (optional) the number of seconds delay between attempts.
			default is 90.
	tryalt: (optional) try the Alternate route every N goes.
		Default: 5 (or half the 'retry' parameter below)
		This can be tryalt:(number from 2 to 100)
			or  tryalt:even		meaning every other go
	remsys:	name of the System file in tables/syn/remsys
	retry: (optional) the number of retries before stopping the the whole
		transmission			Default: 11
		Normally 11 retries is adequate - if slightly too many - but
		you can vary it between 1 and 100 according to taste.
	prior: (optional) priority of this client
		This is a number from 1-99 which is the order in which the
		client is serviced. The client with the lowest number has
		their files sent first.	default is 50
	maxtime: (optional) maximum time in secs to allow for the transmission
		default no limit	eg. 	for a 10 mins timeout :
			maxtime:600	
	maxkill: (optional) script to destroy a program/ftp/script which has taken
		more than 'maxtime'. This is only used if maxtime has been specified
		and is > 0. If no 'maxkill' is specified, just the running PID
		is zapped. If this is 'ipsyn or 'ftp' that will be fine. However
		if it is a script which is running other programs, you need to kill
		all the 'children' too. Script '/fip/local/killer.sff' is an example.

If 'ipsyn' is NOT the transmittor either a program or script or FTP can be used
:
	script:(path and name of script)
		The path name is usually a good idea. Extra parameters can be added
		script:/fip/local/bigcommie "red" "underBed"

You may also use FTP to send. The following keywords are significant :
	useftp: 	Use FTP in place of ipsyn
		if there are no parameters the program starts '/usr/bin/ftp -dinv'
		eg: useftp:/usr/ucb/ftp -zSx

	ftpline: A single line for the FTP command file.
		eg ftpline:binary

General Notes on the Client file
--------------------------------
-- IPSYND ignores the 'remsys' parameter as only 'ipsyn' needs that.

-- These parameters are case insensitive in the CLIENTS file as filenames etc
are automatically forced Uppercase and hostnames lowercase.

Notes for FTP
-------------
-- There are normally at least 2 lines specified is this order :
	ftpline:user logon,passwd
	ftpline:cd /remote/path
where 'logon' and 'passwd' and '/remote/path' are correct for this transmission

-- Other lines could be to send binary rather than ascii text :
	ftpline:binary
or using a proxy server :
	ftpline:proxy open myfirewall
	ftpline:proxy user spy,hole
	ftpline:open clientbox
	ftpline:user anonymous,charles@highgrove.not.so.com

-- Each file in the input queue at the begining of the tranmission is sent
using a 'put' without you needing to specify. Please note that the filename on
the remote system will be the same. So pls tidy the filename BEFORE
transmission.

-- A log line is automatically created in log/syn/CLIENT.date.and.time with the
results of the session

Notes for SCRIPT
----------------
-- the script MUST start '#! (shell)' in the first line or you will get Execlp
error 8.
	eg:	#! /bin/csh		for the c shell
-- Parameters for the script are :
	scriptname	-c client -q queue -s termsvr -p port -l logfile -r inuseflagfile
-z successflagfile
	var0		v1 var2   v3 var4  v5 var6	v7 var8 v9 var10   v11 var12	v13 var14

These variables are :
	0 - program to use
	2 - name of client (forced uppercase)
	4 - name of queue to scan in '/fip/spool/syn' (forced lowercase)
	6 - Terminal Server name	- optional
	8 - Port number or zero if not relevant	- optional
	10 - logfile. Pls write relevant information into this file as the 
		transmission progresses. Normally the file is
			/fip/log/syn/CLIENT.date.and.time
	12 - file to be used as a  I-am-still-running flag
		This file is a flag for IPSYND to say the script is still running
		and the port is still in-use. So IPSYND creates it when the script
		starts but the script MUST delete it when it finishes. If you do
		NOT delete it at the end of transmission, the port will remain
		out-of-use until someone reboots the machine or  use SYN to unlock
		the port manually. The parameter will be top and tailed with
		double quotes as it will contain pipes.
	14 - file to be deleted if the program returns success (0)
		This is the control file for I-need-a-transmission. So if the
		script finishes with no errors (ie so it does NOT need to be
		restarted), it should delete/zap this control file (in
		/fip/spool/syn/control). This file will be top and tailed
		with double quotes as it will contain pipes.
Note that Terminal Server/Hostname and Port Number (and there switches) are
optional depending on whether they have been specified in the PORTS file.

-- a ROUTE in the client file is Optional but, if stated, there MUST be a
corresponding entry on the PORTS file.
-- SYSTEM file (in tables/remsys) and any parameters within are ignored.
-- you can add extra parameters to the script. As it can be in FipSeq, system
varaibles etc can be added.
Additionally any 2 letter header codes can be randomly added to the CLIENT file
EG if the client file is called JUKEBOX and looks like :
;	JUKEBOX
ROUTE:funnycomms
C1:234765403299
ALT:funnycomms
A1:234765400319
L1:SECRET
L2:BINGCROSBY
script:/fip/local/funnies -1 C1 -2 C2 -y L1 -z L2

if there is no entry for 'funnycomms' in the PORTS file will give start
	/fip/local/funnies -1 234765403299 -2 234765400319 -y SECRET -z BINGCROSBY
JUKEBOX jukebox spider3 0 "/fip/log/syn/JUKEBOX.10Jan97.14.10"
"/fip/x/SYN|123|JUKEBOX" "/fip/syn/control/JUKEBOX"
if the entry for 'funnycomms' in the PORTS file is 
	route:funnycomms	host:obnoxiousnoise	port:9191
will give start
	/fip/local/funnies -1 234765403299 -2 234765400319 -y SECRET -z BINGCROSBY
JUKEBOX jukebox obnoxiousnoise 9191 "/fip/log/syn/JUKEBOX.10Jan97.14.10"
"/fip/x/SYN|123|JUKEBOX" "/fip/syn/control/JUKEBOX"

The only input parameter for IPSYND is -v : print version number and exit.

(copyright) 2014 and previous years FingerPost Ltd.