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