Add the first draft of the usermanual and minor changes to adminmanual
[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 line works fine for RedHat and SuSE distributions.  The line required for
42 Slackware distributions is slightly different.  My thanks to Aurelio, PA3EZL for
43 this information.
44 <P>
45 <BLOCKQUOTE><CODE>
46 <PRE>
47 DX:23:respawn:/bin/su - sysop -c "/usr/bin/perl -w /spider/perl/cluster.pl" >/dev/tty7
48 </PRE>
49 </CODE></BLOCKQUOTE>
50 <P>
51 <P>This will automatically start DXSpider on tty7 (ALT-F7) on bootup and restart 
52 it should it crash for any reason.
53 <P>
54 <P>As root type the command <EM>telinit q</EM>.  DXSpider should start up 
55 immediately.  You will see the output on tty7 and if you login as <EM>sysop</EM> 
56 you should find everything running nicely.
57 <P>
58 <P>So far so good, now to automate script connections...
59 <P>
60 <H2><A NAME="ss4.2">4.2 The crontab file</A>
61 </H2>
62
63 <P>Login as <EM>sysop</EM> and create a file in /spider/local_cmd called crontab.  
64 Edit it with your favourite editor and add a line like this (I have included 
65 a comment)
66 <P>
67 <BLOCKQUOTE><CODE>
68 <PRE>
69 # check every 10 minutes to see if gb7xxx is connected and if not
70 # start a connect job going
71
72 0,10,20,30,40,50 * * * * start_connect('gb7xxx') if !connected('gb7xxx')
73 </PRE>
74 </CODE></BLOCKQUOTE>
75 <P>
76 <P>The callsign involved will be the callsign of the cluster node you are 
77 going to connect to.  This will now check every 10 minutes to see if 
78 gb7xxx is connected, if it is then nothing will be done.  If it is not, 
79 then a connect attempt will be started.
80 <P>
81 <P>There are probably lots of other things you could use this crontab file for.  
82 If you want to know more about it, look at the
83 <A HREF="http://www.dxcluster.org/cron.html">DXSpider</A> website 
84 at the cron page where it is explained more fully.
85 <P>
86 <HR>
87 <A HREF="adminmanual-5.html">Next</A>
88 <A HREF="adminmanual-3.html">Previous</A>
89 <A HREF="adminmanual.html#toc4">Contents</A>
90 </BODY>
91 </HTML>