<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
- <TITLE>The DXSpider Installation and Administration Manual : Automating things</TITLE>
+ <TITLE>The DXSpider Administration Manual v1.50: Scripts</TITLE>
<LINK HREF="adminmanual-5.html" REL=next>
<LINK HREF="adminmanual-3.html" REL=previous>
<LINK HREF="adminmanual.html#toc4" REL=contents>
<A HREF="adminmanual-3.html">Previous</A>
<A HREF="adminmanual.html#toc4">Contents</A>
<HR>
-<H2><A NAME="s4">4. Automating things</A></H2>
+<H2><A NAME="s4">4. Scripts</A></H2>
-<P>Ok, you should now have DXSpider running nicely and allowing connects by cluster
-nodes or users. However, it has to be shutdown and restarted manually and if
-connection scripts fail they have to be started again manually too, not much use
-if you are not at the console! So, in this section we will automate both.
-Firstly starting the cluster.
+<P>From 1.48 onwards it will become increasingly possible to control DXSpider's
+operation with scripts of various kinds.
<P>
-<H2><A NAME="ss4.1">4.1 Autostarting the cluster</A>
-</H2>
-
-<P>This is not only a way to start the cluster automatically, it also works as a
-watchdog, checking the sanity of DXSpider and respawning it should it crash for
-any reason. Before doing the following, shutdown the cluster as you did earlier.
-<P>
-<P>Login as root and bring up the /etc/inittab file in your favourite editor. Add
-the following lines to the file near the end ...
+<P>The directory /spider/scripts is where it all happens and is used for several
+things. Firstly it contains a file called startup that can be used to call
+in any changes to the cluster from the default settings on startup. This
+script is executed immediately after all initialisation of the node is done
+but before any connections are possible. Examples of this include how many
+spots it is possible to get with the sh/dx command, whether you want
+registration/passwords to be permanently on etc. An example file is shown
+below and is included in the distribution as startup.issue.
<P>
<BLOCKQUOTE><CODE>
<PRE>
-##Start DXSpider on bootup and respawn it should it crash
-DX:3:respawn:/bin/su -c "/usr/bin/perl -w /spider/perl/cluster.pl" sysop >/dev/tty7
+#
+# startup script example
+#
+# set maximum no of spots allowed to 100
+# set/var $Spot::maxspots = 100
+#
+# Set registration on
+# set/var $main::reqreg = 1
+#
+# Set passwords on
+# set/var $main::passwdreq = 1
+#
</PRE>
</CODE></BLOCKQUOTE>
<P>
-<P>This will automatically start DXSpider on tty7 (ALT-F7) on bootup and restart
-it should it crash for any reason.
+<P>As usual, any text behind a # is treated as a comment and not read. To use
+this file, simply rename it from startup.issue to startup. In our example
+above there are three options. The first option is the amount of spots that
+a user can request with the <EM>sh/dx</EM> command. Normally the default is
+to give 10 spots unless the user specifies more. Without this line enabled,
+the maximum a user can request is 100 spots. Depending on your link quality
+you may wish to enable more or less by specifying the number.
<P>
-<P>As root type the command <EM>telinit q</EM>. DXSpider should start up
-immediately. You will see the output on tty7 and if you login as <EM>sysop</EM>
-you should find everything running nicely.
+<P>The other 2 options are dealt with more fully in the security section.
<P>
-<P>So far so good, now to automate script connections...
-<P>
-<H2><A NAME="ss4.2">4.2 The crontab file</A>
-</H2>
-
-<P>Login as <EM>sysop</EM> and create a file in /spider/local_cmd called crontab.
-Edit it with your favourite editor and add a line like this (I have included
-a comment)
+<P>Secondly, it is used to store the login scripts for users and nodes. Currently
+this can only be done by the sysop but it is envisaged that eventually users will
+be able to set their own. An example is included in the distibution but here is
+a further example.
<P>
<BLOCKQUOTE><CODE>
<PRE>
-# check every 10 minutes to see if gb7xxx is connected and if not
-# start a connect job going
-
-0,10,20,30,40,50 * * * * start_connect('gb7xxx') if !connected('gb7xxx')
+#
+# G0FYD
+#
+blank +
+sh/wwv 3
+blank +
+sh/dx
+blank +
+t g0jhc You abt?
+blank +
</PRE>
</CODE></BLOCKQUOTE>
+<P>The lines in between commands can simply insert a blank line or a character
+such as a + sign to make the output easier to read. Simply create this script
+with your favourite editor and save it with the callsign of the user as the
+filename. Filenames should always be in lower case.
<P>
-<P>The callsign involved will be the callsign of the cluster node you are
-going to connect to. This will now check every 10 minutes to see if
-gb7xxx is connected, if it is then nothing will be done. If it is not,
-then a connect attempt will be started.
+<P>Commands can be inserted in the same way for nodes. A node may wish a series
+of commands to be issued on login, such as a merge command for example.
<P>
-<P>There are probably lots of other things you could use this crontab file for.
-If you want to know more about it, look at the
-<A HREF="http://www.dxcluster.org/cron.html">DXSpider</A> website
-at the cron page where it is explained more fully.
+<P>Thirdly, there are 2 default scripts for users and nodes who do not have a
+specifically defined script. These are <EM>user_default</EM> and
+<EM>node_default</EM>
<P>
<HR>
<A HREF="adminmanual-5.html">Next</A>