Using Up-scripts with KA9Q
It's long been a problem to specify hostnames for some of the KA9Q and Textwin commands
in autoexec.net such as "smtp
server" or "time server", because at the time
they are executed nameservice is not available, since the link is not
connected.
Various options have been suggested:
- Hard-coding IP addresses in autoexec.net or in domain.txt is a Bad Idea because, inevitably, the addresses do change.
- Rearranging autoexec.net so that the server lines
are executed after dialling, and setting
inline onfor dialling, still has a margin of error because routing may not be properly established at the time - especially if the network is busy. - Using the
time autofacility to automatically set the PC clock after logging in is also dangerous, because if your chosen time server cannot be contacted,time autowill cause KA9Q to retry until it can, which may result in you staying online for longer than intended (especially if operating unattended).
The solution is to use the background scripting facility in Demon's customised KA9Q, as follows. All paths and filenames are relative to your KA9Q directory.
-
Remove calls to
"time server","time auto"or"time set","smtp gateway","smtp timer","smtp kick"and"nntp kick"from autoexec.net. -
Create an ASCII file called, e.g., timeset.scr, containing the
following:
and another one called smtpcli.scr like this:time server ntp.demon.co.uk
time set
Change the "60" on thesmtp gateway post.demon.co.uk
smtp timer 60
smtp kick
smtp timerline to be whatever it was in autoexec.net. -
If you already have 'up' and 'down' scripts, continue at step 5. Hint: look for a file called "scripts"
like the one in step 4, and for 'up' and 'down'
in directory spool\scripts. The 'up' script would typically contain
smtp kick,nntp kickandfinger@postcommands. The 'down' script would typically be empty. If you haven't, then continue at step 4. -
Create a file called 'scripts' which looks like this:
These inform KA9Q that a script called 'up' should be executed on connection to the vPoP's, and one called 'down' upon disconnection. If you use one of the tPoPs you should add its IP address here too - you will see it as the "remote IP address" if you do a0.0.0.0 up down
158.152.1.222 up down
"ppp sl0"after connecting (or"ppp ax1"for founder members).Create blank files called 'spool\scripts\up' and 'spool\scripts\down'.
-
Add the following lines to the 'up' script.
There is a slight risk here of losing news articles, if the clock in your PC drifts a lot. If, when KA9Q sets the clock, the correction is normally more than about a minute, then change the# This is where we put startup commands that require host resolution
finger status@gate.demon.co.uk
finger yourhostname@post.demon.co.uk
sourceb timeset.scr
sourceb smtpcli.scr
nntp kick
nntp kickline above to say'at now+0001 "nntp kick"'. This will ensure that your clock is set correctly before starting a news transfer, at the expense of waiting up to a minute before the transfer starts.Note that, if you were to put the commands from either of the "sourceb" background scripts directly into the up script, you would no longer be able to log on to Demon. You'd find that, after logging on, the link appeared to hang. So don't :-)
-
If you have a line in autoexec.net of the form
'ppp sl0 idle 60 exit', change it to say'at now+0001 "ppp sl0 idle 60 exit" '- with the double quotes but without the single ones. This is because adjusting the clock backwards would otherwise cause the idle exit to occur immediately. By putting it on a timer, the worst that happens is you wait an extra minute before logging off. If this bothers you, then don't do it, and be prepared that about a third of the time (depending on speed of your PC) your session may exit immediately after setting the clock. -
That's it ! You will now no longer experience a two minute delay on
startup whilst the DNS lookup of ntp.demon.co.uk fails. And you are
no longer at risk of
time autositting there, banging its head against a failed ntpd, and keeping you online for hours on end.