rearrange spot broadcast so that it copes according to terminal type
[spider.git] / html / installation-3.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2 <HTML>
3 <HEAD>
4  <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
5  <TITLE>The DXSpider Installation Manual v1.48: Configuration</TITLE>
6  <LINK HREF="installation-4.html" REL=next>
7  <LINK HREF="installation-2.html" REL=previous>
8  <LINK HREF="installation.html#toc3" REL=contents>
9 <link rel=stylesheet href="style.css" type="text/css" title="default stylesheet">
10 </HEAD>
11 <BODY>
12 <A HREF="installation-4.html">Next</A>
13 <A HREF="installation-2.html">Previous</A>
14 <A HREF="installation.html#toc3">Contents</A>
15 <HR>
16 <H2><A NAME="s3">3. Configuration</A></H2>
17
18 <H2><A NAME="ss3.1">3.1 Allowing ax25 connects from users</A>
19 </H2>
20
21 <P>As stated previously, the aim of this document is not to tell you how to 
22 configure Linux or the ax25 utilities.  However, you do need to add a line 
23 in your ax25d.conf to allow connections to DXSpider for your users.  For
24 each interface that you wish to allow connections on, use the following format ...
25 <P>
26 <BLOCKQUOTE><CODE>
27 <PRE>
28 default  * * * * * *  - sysop /spider/src/client client %u ax25
29 </PRE>
30 </CODE></BLOCKQUOTE>
31 <P>or, if you wish your users to be able to use SSID's on their callsigns ..
32 <P>
33 <BLOCKQUOTE><CODE>
34 <PRE>
35 default  * * * * * *  - sysop /spider/src/client client %s ax25
36 </PRE>
37 </CODE></BLOCKQUOTE>
38 <P>For most purposes this is not desirable. The only time you probably will 
39 need this is when you need to allow other cluster nodes that are using SSID's
40 in. In this case it would probably be better to use the first example and 
41 then add a specific line for that node like this:
42 <P>
43 <BLOCKQUOTE><CODE>
44 <PRE>
45 GB7DJK-2  * * * * * *  - sysop /spider/src/client client gb7djk-2 ax25
46 default  * * * * * *  - sysop /spider/src/client client %u ax25
47 </PRE>
48 </CODE></BLOCKQUOTE>
49 <P>
50 <H2><A NAME="ss3.2">3.2 Allowing telnet connects from users </A>
51 </H2>
52
53 <P> 
54 From version 1.47 there is a new (more efficient) way of doing this
55 (see next section) but, if you prefer, the method of doing it described 
56 here will continue to work just fine.
57 <P>
58 <P>Allowing telnet connections is quite simple.  Firstly you need to add a line 
59 in /etc/services to allow connections to a port number, like this ....
60 <P>
61 <BLOCKQUOTE><CODE>
62 <PRE>
63 spdlogin   8000/tcp     # spider anonymous login port
64 </PRE>
65 </CODE></BLOCKQUOTE>
66 <P>Then add a line in /etc/inetd.conf like this ....
67 <P>
68 <BLOCKQUOTE><CODE>
69 <PRE>
70 spdlogin stream tcp nowait root /usr/sbin/tcpd /spider/src/client login telnet
71 </PRE>
72 </CODE></BLOCKQUOTE>
73 <P>
74 <P>Once this is done, you need to restart inetd like this ....
75 <P>
76 <BLOCKQUOTE><CODE>
77 <PRE>
78 killall -HUP inetd
79 </PRE>
80 </CODE></BLOCKQUOTE>
81 <P>
82 <P>
83 <P>Now login as <EM>sysop</EM> and cd spider/src. You can test that spider 
84 is accepting telnet logins by issuing the following command ....
85 <P>
86 <BLOCKQUOTE><CODE>
87 <PRE>
88 ./client login telnet
89 </PRE>
90 </CODE></BLOCKQUOTE>
91 <P>You should get a login prompt and on issuing a callsign, you will be given 
92 access to the cluster.  Note, you will not get a password login.  There seems 
93 no good reason for a password prompt to be given so it is not asked for.
94 <P>
95 <P>Assuming all is well, then try a telnet from your linux console ....
96 <P>
97 <BLOCKQUOTE><CODE>
98 <PRE>
99 telnet localhost 8000
100 </PRE>
101 </CODE></BLOCKQUOTE>
102 <P>
103 <P>You should now get the login prompt and be able to login as before.
104 <P>
105 <H2><A NAME="ss3.3">3.3 Setting up telnet connects (from 1.47 onwards)</A>
106 </H2>
107
108 <P>From version 1.47 you can choose to allow the perl cluster.pl program to 
109 allow connections directly (i.e. not via the <CODE>/spider/src/client</CODE>
110 interface program). If you are using Windows then this is the only method
111 available of allowing incoming telnet connections.
112 <P>
113 <P>To do this you need first to remove any line that you may previously have set
114 up in /etc/inetd.conf. Remember to:-
115 <P>
116 <BLOCKQUOTE><CODE>
117 <PRE>
118 killall -HUP inetd
119 </PRE>
120 </CODE></BLOCKQUOTE>
121 <P>
122 <P>to make the change happen...
123 <P>
124 <P>Having done that, you need to copy the file 
125 <EM>/spider/perl/Listeners.pm</EM> to <EM>/spider/local</EM> and 
126 then edit it. You will need to uncomment the line containing &quot;0.0.0.0&quot; 
127 and select the correct port to listen on. So that it looks like this:-
128 <P>
129 <BLOCKQUOTE><CODE>
130 <PRE>
131 @listen = (
132     ["0.0.0.0", 8000],
133 );
134 </PRE>
135 </CODE></BLOCKQUOTE>
136 <P>
137 <P>As standard, the listener will listen on all interfaces simultaneously. 
138 If you require more control than this, you can specify each interface 
139 individually:-
140 <P>
141 <BLOCKQUOTE><CODE>
142 <PRE>
143 @listen = (
144     ["gb7baa.dxcluster.net", 8000],
145     ["44.131.16.2", 6300],
146 );
147 </PRE>
148 </CODE></BLOCKQUOTE>
149 <P>
150 <P>This will only be successful if the IP addresses on each interface are static. 
151 If you are using some kind of dynamic IP addressing then the 'default' method 
152 is the only one that will work.
153 <P>
154 <P>Restart the cluster.pl program to enable the listener.
155 <P>
156 <P>One important difference with the internal listener is that no echoing 
157 is done by the cluster program. Users will need to set 'local-echo' on in 
158 their telnet clients if it isn't set automatically (as per the standards). 
159 Needless to say this will probably only apply to Windows users. 
160 <P>
161 <H2><A NAME="ss3.4">3.4 Setting up for AGW Engine (1.47 onwards)</A>
162 </H2>
163
164 <P>AGW Engine is a Windows based ax25 stack. You can connect to an AGW engine 
165 from Linux as well as Windows based machines.
166 <P>
167 <P>In order to enable access to an AGW Engine you need to copy 
168 <EM>/spider/perl/AGWConnect.pm</EM> to <EM>/spider/local</EM> and edit it. 
169 Specifically you must:-
170 <P>
171 <UL>
172 <LI> set <CODE>$enable</CODE> to 1.</LI>
173 <LI> set <CODE>$login</CODE> and <CODE>$passwd</CODE> to the values set up in your AGW installation. 
174 If you haven't set any there, then you should not touch these values.</LI>
175 <LI> You can connect to a remote AGW engine (ie on some other machine) by changing <CODE>$addr</CODE>
176 and <CODE>$port</CODE> appropriately.</LI>
177 <LI> Restart the cluster.pl program</LI>
178 </UL>
179    
180 <P>
181 <P>
182 <H2><A NAME="ss3.5">3.5 Setting up node connects</A>
183 </H2>
184
185 <P>In order to allow cluster node connections, spider needs to know that the 
186 connecting callsign is a cluster node.  This is the case whether the connect 
187 is incoming or outgoing.  In spider this is a simple task and can be done in 
188 runtime.
189 <P>
190 <P>Later versions of Spider can distinguish different software and treat them
191 differently.  For example, the WCY beacon cannot be handles by AK1A type
192 nodes as AK1A does not know what to do with PC73.  There are 4 different
193 types of node at present and although they may not have any major
194 differences at the moment, it allows for compatibility.  The 4 types are ...
195 <P>
196 <BLOCKQUOTE><CODE>
197 <PRE>
198 set/node        (AK1A type)
199 set/spider
200 set/dxnet
201 set/clx
202 </PRE>
203 </CODE></BLOCKQUOTE>
204 <P>
205 <P>For now, we will assume that the cluster we are going to connect to is an
206 AK1A type node.
207 <P>
208 <P>Start up the cluster as you did before and login as the sysop with client.
209 The cluster node I am wanting to make a connection to is GB7BAA but you would
210 obviously use whatever callsign you required.  At the prompt type ...
211 <P>
212 <BLOCKQUOTE><CODE>
213 <PRE>
214 set/node gb7baa
215 </PRE>
216 </CODE></BLOCKQUOTE>
217 <P>
218 <P>The case does not matter as long as you have a version of DXSpider later than 
219 1.33.  Earlier versions required the callsign to be in upper case.
220 <P>
221 <P>That is now set, it is as simple as that.  To prove it, login on yet another 
222 console as sysop, cd to spider/src and issue the command ...
223 <P>
224 <BLOCKQUOTE><CODE>
225 <PRE>
226 ./client gb7baa (using the callsign you set as a node)
227 </PRE>
228 </CODE></BLOCKQUOTE>
229 <P>
230 <P>You should get an initialisation string from DXSpider like this ...
231 <P>
232 <BLOCKQUOTE><CODE>
233 <PRE>
234 ./client gb7baa
235 PC38^GB7MBC^~
236 </PRE>
237 </CODE></BLOCKQUOTE>
238 <P>If the callsign you just set up as a cluster node is for an incoming connect, 
239 this is all that needs to be done.  If the connection is to be outgoing then 
240 a connection script needs to be written.
241 <P>
242 <P>Sometimes you make a mistake... Honest, it does happen.  If you want to make a node
243 back to being a normal user, regardless
244 of what type it is, do:
245 <P>
246 <BLOCKQUOTE><CODE>
247 <PRE>
248 unset/node gb7baa
249 </PRE>
250 </CODE></BLOCKQUOTE>
251 <P>
252 <H2><A NAME="ss3.6">3.6 Connection scripts</A>
253 </H2>
254
255 <P>Because DXSpider operates under Linux, connections can be made using just about 
256 any protocol;  AX25, NETRom, tcp/ip, ROSE etc are all possible examples.  
257 Connect scripts live in the /spider/connect directory and are simple ascii files.  
258 Writing a script for connections is therefore relatively simple.  
259 <P>
260 <P>The connect scripts consist of lines which start with the following keywords 
261 or symbols:-
262 <P>
263 <DL>
264 <P>
265 <DT><B>#</B><DD><P>All lines starting with a <CODE>#</CODE> are ignored, as are completely 
266 blank lines.
267 <P>
268 <DT><B>timeout</B><DD><P><CODE>timeout</CODE> followed by a number is the number of seconds to wait for a 
269 command to complete. If there is no timeout specified in the script 
270 then the default is 60 seconds.
271 <P>
272 <DT><B>abort</B><DD><P><CODE>abort</CODE> is a regular expression containing one or more strings to look 
273 for to abort a connection. This is a perl regular expression and is 
274 executed ignoring case.
275 <P>
276 <DT><B>connect</B><DD><P><CODE>connect</CODE> followed by ax25, agw (for Windows users) or telnet and some type dependent 
277 information. In the case of a telnet connection, there can be up to 
278 two parameters.
279 The first is the ip address or hostname of the computer you wish to 
280 connect to and the second is the port number you want to use (this 
281 can be left out if it is a normal telnet session).
282 In the case of an ax25 session then this would normally be a call to
283 ax25_call or netrom_call as in the example above. It is your
284 responsibility to get your node and other ax25 parameters to work 
285 before going down this route!
286 <P>
287 <DT><B>'</B><DD><P><CODE>'</CODE> is the delimiting character for a word or phrase of an expect/send 
288 line in a chat type script. The words/phrases normally come in pairs,
289 either can be empty. Each line reads input from the connection until 
290 it sees the string (or perl regular expression) contained in the
291 left hand string. If the left hand string is empty then it doesn't 
292 read or wait for anything. The comparison is done ignoring case.
293 When the left hand string has found what it is looking for (if it is)
294 then the right hand string is sent to the connection.
295 This process is repeated for every line of chat script. 
296 <P>
297 <DT><B>client</B><DD><P><CODE>client</CODE> starts the connection, put the arguments you would want here 
298 if you were starting the client program manually. You only need this 
299 if the script has a different name to the callsign you are trying to 
300 connect to (i.e. you have a script called other which actually 
301 connects to GB7DJK-1 [instead of a script called gb7djk-1]).
302 </DL>
303 <P>
304 <P>There are many possible ways to configure the script but here are three examples, 
305 one for a NETRom/AX25 connect, one for AGW engines and one for tcp/ip.  
306 <P>
307 <BLOCKQUOTE><CODE>
308 <PRE>
309 timeout 60
310 abort (Busy|Sorry|Fail)
311 # don't forget to chmod 4775 netrom_call!
312 connect ax25 /usr/sbin/netrom_call bbs gb7djk g1tlh
313 'Connect' '' 
314 'Connect' 'c np7'
315 'Connect' 'c gb7dxm'
316 # you can leave this out if you call the script 'gb7dxm'
317 client gb7dxm ax25
318 </PRE>
319 </CODE></BLOCKQUOTE>
320 <P>
321 <P>
322 <P>
323 <BLOCKQUOTE><CODE>
324 <PRE>
325 timeout 60
326 abort (Busy|Sorry|Fail)
327 # this does exactly the same as the previous example
328 # the '1' is the AGW port number to connect thru for g1tlh
329 connect agw 1 g1tlh
330 'Connect' '' 
331 'Connect' 'c np7'
332 'Connect' 'c gb7dxm'
333 # you can leave this out if you call the script 'gb7dxm'
334 client gb7dxm ax25
335 </PRE>
336 </CODE></BLOCKQUOTE>
337 <P>
338 <P>
339 <P>
340 <BLOCKQUOTE><CODE>
341 <PRE>
342 timeout 15
343 connect telnet dirkl.tobit.co.uk
344 'login' 'gb7djk'
345 'word' 'gb7djk'
346 # tell GB7DJK-1 that it is connected to GB7DJK
347 # you can leave this out if you call this script 'gb7djk'
348 client gb7djk telnet
349 </PRE>
350 </CODE></BLOCKQUOTE>
351 <P>
352 <P>Both these examples assume that everything is set up properly at the other end.  
353 You will find other examples in the /spider/examples directory.
354 <P>
355 <H2><A NAME="ss3.7">3.7 Starting the connection</A>
356 </H2>
357
358 <P>You start the connection, from within a sysop enabled cluster login, by typing 
359 in the word <EM>connect</EM> followed by a script name like this ....
360 <P>
361 <BLOCKQUOTE><CODE>
362 <PRE>
363 G0VGS de GB7MBC 13-Dec-1998 2041Z >connect gb7djk-1
364 connection to GB7DJK-1 started
365 G0VGS de GB7MBC 13-Dec-1998 2043Z >
366 </PRE>
367 </CODE></BLOCKQUOTE>
368 <P>This will start a connection using the script called <EM>gb7djk-1</EM>.  You can
369 follow the connection by watching the term or console from where you started
370 <EM>cluster.pl</EM>.  From version 1.47 onwards, you will need to <CODE>set/debug connect</CODE> first.
371 You should see something like this ...
372 <P>
373 <BLOCKQUOTE><CODE>
374 <PRE>
375 &lt;- D G1TLH connect gb7djk-1
376 -> D G1TLH connection to GB7DJK-1 started
377 -> D G1TLH G1TLH de GB7DJK 13-Dec-1998 2046Z >
378 timeout set to 15
379 CONNECT sort: telnet command: dirkl.tobit.co.uk
380 CHAT "login" -> "gb7djk"
381 received "
382 Red Hat Linux release 5.1 (Manhattan)
383 Kernel 2.0.35 on an i586
384 "
385 received "login: "
386 sent "gb7djk"
387 CHAT "word" -> "gb7djk"
388 received "gb7djk"
389 received "Password: "
390 sent "gb7djk"
391 Connected to GB7DJK-1, starting normal protocol
392 &lt;- O GB7DJK-1 telnet
393 -> B GB7DJK-1 0
394 GB7DJK-1 channel func  state 0 -> init
395 &lt;- D GB7DJK-1 
396 &lt;- D GB7DJK-1 Last login: Sun Dec 13 17:59:56 from dirk1
397 &lt;- D GB7DJK-1 PC38^GB7DJK-1^~
398 &lt;- D GB7DJK-1 PC18^ 1 nodes, 0 local / 1 total users  Max users 0  Uptime 
399 0 00:00^5447^~
400     etc
401 </PRE>
402 </CODE></BLOCKQUOTE>
403 <P>
404 <P>With later versions of Spider there is a set/login command for users.  This 
405 tells them when a user or node logs in or out.  If you do not add a line to 
406 your scripts after the final line (or before the client line which should always 
407 be last if needed) then the login/logout information will be sent to users
408 <I>before</I> the login actually completes.  This means if a node is 
409 unreachable, it will continue sending logins and logouts to users even though it 
410 is not actually connecting.  To avoid this use the following line ...
411 <P>
412 <BLOCKQUOTE><CODE>
413 <PRE>
414 'connect' ''
415 </PRE>
416 </CODE></BLOCKQUOTE>
417 <P>
418 <P>In a script, this might look like ...
419 <P>
420 <BLOCKQUOTE><CODE>
421 <PRE>
422 timeout 35 
423 abort (Busy|Sorry|Fail)
424 connect telnet mary 3000
425 'ogin:' 'gb7mbc'
426 '>' 'telnet 44.131.93.96 7305'
427 'connect' ''
428 </PRE>
429 </CODE></BLOCKQUOTE>
430 <P>
431 <H2><A NAME="ss3.8">3.8 Telnet echo</A>
432 </H2>
433
434 <P>Cluster links in particular suffer greatly from the presence of telnet echo.  
435 This is caused by the telnet negotiation itself and can create at worst severe 
436 loops.  At best it creates unnecessary bandwidth and large logfiles!  There are
437 things that can be done to limit this problem but will not always work dependent 
438 on the route taken to connect.
439 <P>
440 <P>Telnet echo itself should only be a problem if the connection is being made to 
441 the telnet port (23).  This port uses special rules that include echo negotiation.
442 If the connection is to a different port, such as 7300, this negotiation does 
443 not happen and therefore no echo should be present.
444 <P>
445 <P>Sometimes it is not possible to make a direct connection to another node and this 
446 can cause problems.  There is a way of trying to suppress the telnet echo but 
447 this will not always work, unfortunately it is difficult to be more specific.  
448 Here is an example of what I mean ...
449 <P>
450 <BLOCKQUOTE><CODE>
451 <PRE>
452 timeout 35
453 abort (Busy|Sorry|Fail)
454 connect telnet mary.lancs.ac.uk
455 'ogin:' 'gb7mbc'
456 'word:' 'mypasswd'
457 '\$' 'stty -echo raw'
458 '\$' 'telnet 44.131.93.96'
459 'connect' ''
460 </PRE>
461 </CODE></BLOCKQUOTE>
462 <P>So, the first connection is made by Spider.  This is fine as Spider uses the
463 Net_Telnet script from within perl.  This actually uses TCP rather than TELNET 
464 so no negotiation will be done on the first connection.  Once connected to
465 mary.lancs.ac.uk, the command is sent to suppress echo.  Now a telnet is made 
466 to a cluster node that is accepting connections on port 23.  The problem with 
467 this link is that the negotiation is made by the remote machine, therefore you 
468 have no control over it.  The chances are that this link will create echo and 
469 there will be no way you can stop it.
470 <P>
471 <P>
472 <H2><A NAME="ss3.9">3.9 Autostarting the cluster</A>
473 </H2>
474
475 <P>Ok, you should now have DXSpider running nicely and allowing connects by cluster
476 nodes or users.  However, it has to be shutdown and restarted manually.  It
477 would be much easier to have it start automatically. 
478 <P>
479 <P>This is not only a way to start the cluster automatically, it also works as a
480 watchdog, checking the sanity of DXSpider and respawning it should it crash for 
481 any reason.  Before doing the following, shutdown the cluster as you did earlier.
482 <P>
483 <P>Login as root and bring up the /etc/inittab file in your favourite editor.  Add 
484 the following lines to the file near the end ...
485 <P>
486 <BLOCKQUOTE><CODE>
487 <PRE>
488 ##Start DXSpider on bootup and respawn it should it crash
489 DX:3:respawn:/bin/su -c "/usr/bin/perl -w /spider/perl/cluster.pl" sysop >/dev/tty7
490 </PRE>
491 </CODE></BLOCKQUOTE>
492 <P>
493 <P>This line works fine for RedHat distributions. It is also fine for SuSE up to
494 7.0.  From Suse 7.1 you need to add runlevels 2 and 5 like this ...
495 <P>
496 <BLOCKQUOTE><CODE>
497 <PRE>
498 DX:235:respawn:/bin/su -c "/usr/bin/perl -w /spider/perl/cluster.pl" sysop >/dev/tty7
499 </PRE>
500 </CODE></BLOCKQUOTE>
501 <P>
502 <P>The line required for Slackware distributions is slightly different.  My thanks to 
503 Aurelio, PA3EZL for this information.
504 <P>
505 <BLOCKQUOTE><CODE>
506 <PRE>
507 DX:23:respawn:/bin/su - sysop -c "/usr/bin/perl -w /spider/perl/cluster.pl" >/dev/tty7
508 </PRE>
509 </CODE></BLOCKQUOTE>
510 <P>
511 <P>This will automatically start DXSpider on tty7 (ALT-F7) on bootup and restart 
512 it should it crash for any reason.
513 <P>
514 <P>As root type the command <EM>telinit q</EM>.  DXSpider should start up 
515 immediately.  You will see the output on tty7 and if you login as <EM>sysop</EM> 
516 you should find everything running nicely.
517 <P>
518 <HR>
519 <A HREF="installation-4.html">Next</A>
520 <A HREF="installation-2.html">Previous</A>
521 <A HREF="installation.html#toc3">Contents</A>
522 </BODY>
523 </HTML>