Added helpfile for forward/latlong and updated admin manual. Resolved
[spider.git] / html / adminmanual-4.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 and Administration Manual : Automating things</TITLE>
6  <LINK HREF="adminmanual-5.html" REL=next>
7  <LINK HREF="adminmanual-3.html" REL=previous>
8  <LINK HREF="adminmanual.html#toc4" REL=contents>
9 </HEAD>
10 <BODY>
11 <A HREF="adminmanual-5.html">Next</A>
12 <A HREF="adminmanual-3.html">Previous</A>
13 <A HREF="adminmanual.html#toc4">Contents</A>
14 <HR>
15 <H2><A NAME="s4">4. Automating things</A></H2>
16
17 <P>Ok, you should now have DXSpider running nicely and allowing connects by cluster
18 nodes or users.  However, it has to be shutdown and restarted manually and if
19 connection scripts fail they have to be started again manually too, not much use 
20 if you are not at the console!  So, in this section we will automate both.  
21 Firstly starting the cluster.
22 <P>
23 <H2><A NAME="ss4.1">4.1 Autostarting the cluster</A>
24 </H2>
25
26 <P>This is not only a way to start the cluster automatically, it also works as a
27 watchdog, checking the sanity of DXSpider and respawning it should it crash for 
28 any reason.  Before doing the following, shutdown the cluster as you did earlier.
29 <P>
30 <P>Login as root and bring up the /etc/inittab file in your favourite editor.  Add 
31 the following lines to the file near the end ...
32 <P>
33 <BLOCKQUOTE><CODE>
34 <PRE>
35 ##Start DXSpider on bootup and respawn it should it crash
36 DX:3:respawn:/bin/su -c "/usr/bin/perl -w /spider/perl/cluster.pl" sysop >/dev/tty7
37 </PRE>
38 </CODE></BLOCKQUOTE>
39 <P>
40 <P>This will automatically start DXSpider on tty7 (ALT-F7) on bootup and restart 
41 it should it crash for any reason.
42 <P>
43 <P>As root type the command <EM>telinit q</EM>.  DXSpider should start up 
44 immediately.  You will see the output on tty7 and if you login as <EM>sysop</EM> 
45 you should find everything running nicely.
46 <P>
47 <P>So far so good, now to automate script connections...
48 <P>
49 <H2><A NAME="ss4.2">4.2 The crontab file</A>
50 </H2>
51
52 <P>Login as <EM>sysop</EM> and create a file in /spider/local_cmd called crontab.  
53 Edit it with your favourite editor and add a line like this (I have included 
54 a comment)
55 <P>
56 <BLOCKQUOTE><CODE>
57 <PRE>
58 # check every 10 minutes to see if gb7xxx is connected and if not
59 # start a connect job going
60
61 0,10,20,30,40,50 * * * * start_connect('gb7xxx') if !connected('gb7xxx')
62 </PRE>
63 </CODE></BLOCKQUOTE>
64 <P>
65 <P>The callsign involved will be the callsign of the cluster node you are 
66 going to connect to.  This will now check every 10 minutes to see if 
67 gb7xxx is connected, if it is then nothing will be done.  If it is not, 
68 then a connect attempt will be started.
69 <P>
70 <P>There are probably lots of other things you could use this crontab file for.  
71 If you want to know more about it, look at the
72 <A HREF="http://www.dxcluster.org/cron.html">DXSpider</A> website 
73 at the cron page where it is explained more fully.
74 <P>
75 <HR>
76 <A HREF="adminmanual-5.html">Next</A>
77 <A HREF="adminmanual-3.html">Previous</A>
78 <A HREF="adminmanual.html#toc4">Contents</A>
79 </BODY>
80 </HTML>