Contents:

A) First install
B) Upgrading existing installations
C) What to do after installation

================

If you have never installed daemontools, qmail and friends, you should
have a simple task.  Indeed, using the rpms in this directory,
install, in this order

daemontools
ucspi-tcp
qmail 1.03-109memphis # if you want to use qmail
djbdns		      # if you want to set up a qmail server
		      # this is almost compulsory; indeed, with a
		      # single simple command, you have a caching
		      # nameserver running---and setting up a
		      # nameserver is much simpler than setting up
		      # BIND. 

runlevelconf
dt-run
qmail-run             # if you want it
other-run             # if you want it

Now go to section C),  "What to do after installation".


B) Upgrading existing installations
===================================

You need to install the following rpms before dt-run's:

daemontools 0.76 or above
ucspi-tcp 0.88 or above
qmail 1.03-109memphis or above # if you want to use qmail
runlevelconf 0.08 or above

so do not forget to have them handy when it comes to install them (not
yet, except the qmail rpm)

Unfortunately, (well, not very much, considering the gain), the
incompatibilities between older versions (=< 0.60)of daemontools and
friends is too great, and my best advice to you when you upgrade:
remove the older packages with `rpm -e'.  Indeed, basically, we are
setting up a parallel, complete sysV init scheme---without start/stop
sequence numbers.

The main problem is that the new daemontools package can not stop your
services via the init files set up by qmail-run-4 or
tcpserver-initscripts or ucspi-tcp-run, and the old one cannot deal
with the new run scripts.  Also, there are new packages, and
tcpserver-initscripts and ucspi-tcp-run are obsolete.

The simplest thing to do is, save the log files and config files, and
then follow the following schedule in "cleaning" your system from
obsolete rpms/files. 

The first two steps should be done by the removal of the rpms, but I'd
be on the safe side ....  

* Stop the services controlled by qmail-run, tcpserver-initscripts and
  ucspi-tcp-run.  Since RH stopped using the `.init' extension on
  initscripts, examining the output of 

  find /etc/rc.d/init.d -name "*.init" 

  will give you a list of services that are probably managed by
  scripts from the rpms qmail-run, tcpserver-initscripts and
  ucspi-tcp-run.  If they all are, you can just do

  for i in $(find /etc/rc.d/init.d -name "*.init"); do
      $i stop
  done

* Remove the links in the /etc/rc.d/rc?.d directories.  Again, this
  could be as simple as 

  for i in $(find /etc/rc.d/init.d -name "*.init"); do
      chkconfig --del $(basename $i)
  done   

  but non-RH users may not have chkconfig, and so they may need to
  examine

  find /etc/rc.d/rc?.d -name "*.init*"
  
* if you have it: rpm -e tcpserver-initscripts

* if you have it: rpm -e ucspi-tcp-run

* if you have it: rpm -e qmail-run

* Stop all services that use daemontools < 0.70.  This includes
  svscan! 

* To avoid problems, you may want to clean out the /service
  directory. 

* if you have it: rpm -e rblsmtpd

Now the installation should be simple. Use the latest rpms from the
ftp directory

ftp://moni.msci.memphis.edu/pub/run

Of course use full rpm file name when you install

* rpm -Uvh  daemontools ucspi-tcp   

* Below, `qmail-run' and `other-run' is optional.  To run dnscache,
  you just need dt-run.

  rpm -Uvh runlevelconf dt-run qmail-run other-run

C) What to do after installation
================================

First of all, you may want to read the section `The default install
locations and its defense' in the INSTALL file to understand why I use
a rather unusual location of files.  

The qmail-run rpm sets up the appropriate sendmail links and the basic
qmail aliases.  

Find the lines in inittab which start the rc file at the various
runlevels; they are  

l0:0:wait:/etc/rc.d/rc 0
l1:1:wait:/etc/rc.d/rc 1
l2:2:wait:/etc/rc.d/rc 2
l3:3:wait:/etc/rc.d/rc 3
l4:4:wait:/etc/rc.d/rc 4
l5:5:wait:/etc/rc.d/rc 5
l6:6:wait:/etc/rc.d/rc 6

Put the lines

### stop dt-run
rK:016:wait:/var/service/dt-run/dt-runlevel.init stop
sK:016:wait:/var/service/dt-run/dt-svscan.init stop
### End stop dt-run

*before* the "rc" lines, and put the lines

### start dt-run 
sS:2345:wait:/var/service/dt-run/dt-svscan.init start
r2:2:wait:/var/service/dt-run/dt-runlevel.init start
r3:3:wait:/var/service/dt-run/dt-runlevel.init start
r4:4:wait:/var/service/dt-run/dt-runlevel.init start
r5:5:wait:/var/service/dt-run/dt-runlevel.init start
### End start dt-run

*after* the `rc' lines.  

So, now you have 

### stop dt-run
rK:016:wait:/var/service/dt-run/dt-runlevel.init stop
sK:016:wait:/var/service/dt-run/dt-svscan.init stop
### End stop dt-run

l0:0:wait:/etc/rc.d/rc 0
l1:1:wait:/etc/rc.d/rc 1
l2:2:wait:/etc/rc.d/rc 2
l3:3:wait:/etc/rc.d/rc 3
l4:4:wait:/etc/rc.d/rc 4
l5:5:wait:/etc/rc.d/rc 5
l6:6:wait:/etc/rc.d/rc 6

### start dt-run 
sS:2345:wait:/var/service/dt-run/dt-svscan.init start
r2:2:wait:/var/service/dt-run/dt-runlevel.init start
r3:3:wait:/var/service/dt-run/dt-runlevel.init start
r4:4:wait:/var/service/dt-run/dt-runlevel.init start
r5:5:wait:/var/service/dt-run/dt-runlevel.init start
### End start dt-run

If you now run

telinit q

or 

init q

you should have svscan running.  You can check with the command

/var/service/dt-run/dt-svscan.init status

( or `svstat /var/service/svscan') and you should get svstat's output

/var/service/svscan: up (pid 6361) 21 seconds, normally down

Now decide which services you want to run under svscan.  For
`service', the run file is

/var/service/`service'/run

The run files are quite generic and you may want to change some.  For
example, the default rblsmtpd run file has 

COMMAND="rblsmtpd qmail-smtpd"

which does not work presently because then rblsmtpd would try to use rbl.maps.vix.com which is not available publicly.  I have (on one line)

COMMAND="rblsmtpd -r relays.osirusoft.com
		  -r bl.spamcop.net qmail-smtpd"

For some of the services, it is appropriate to set up tcprules files.
Keep in mind, that the run files of the default installation expects
the `.cdb' files to be

/var/service/`service'/tcprules.cdb

so, for example,

/var/service/rblsmtpd/tcprules.cdb

This means that you may want to copy the tcprules and cdb files from
the old /etc/tcprules.d; so, for example

cp /etc/tcprules.d/rblsmtpd /var/service/rblsmtpd/tcprules
cp /etc/tcprules.d/rblsmtpd.cdb /var/service/rblsmtpd/tcprules.cdb

(You can, of course, just change the run files to look for the cdb
files elsewhere.)

There are three kinds of services to be run under svscan:

First kind: the qmail-run and the other-run packages installed run
	    files for it.

Second kind: you will install run files for it, and the add-service.sh
	     script knows about the service.

Third kind: you will install run files for it, and you will tell the
	    add-service.sh script about the service.

You can find out which services add-service.sh knows about by doing

add-service.sh list

Presently, the output is

axfrdns
dnscache
fingerd
ftpd     # intended for publicfile's
httpd    # intended for publicfile's
proftpd
rlogind
rshd
rsync
qmail
qmail-pop3d
qmail-smtpd
qmail-qmtpd
qmail-qmqpd
pickdns
rbldns
rblsmtpd
telnetd
tinydns
walldns
wuftpd

Of these,

fingerd
ftpd     # intended for publicfile's
httpd	 # intended for publicfile's
proftpd
rlogind
rshd
rsync
qmail
qmail-pop3d
qmail-smtpd
qmail-qmtpd
qmail-qmqpd
rblsmtpd
telnetd
wuftpd

are of the first kind.

For a service of the first kind, you can do the following.  Suppose
you want to run qmail, qmail-smtpd and telnetd.  Then you do (assuming
add-service.sh is in your $PATH) 

add-service.sh qmail qmail-smtpd telnetd

No later than 5 seconds, all the supervises for these services should
start. If the current runlevel is such that a service should run at
it, then the service will also be started.  For example, with the
default configuration of add-service.sh, if the present runlevel is 2,
then only qmail will be started.  If the current runlevel is 3, all
three services will be started.

You can check if the services are running using `service.init status';
for example at runlevel 2, I see

qmail.init status
/service/qmail: up (pid 7099) 168 seconds

qmail-smtpd.init status
/service/qmail-smtpd: down 171 seconds

telnetd.init status    
/service/telnetd: down 182 seconds

You can do many other things with `service.init'; among others, you
can stop/start `service'.  (Often, it is more convenient to use `svc'
than `service.init', but for some functions, like start and stop, you
get nice dressing in `service.init')

For a service of the second kind, you need to set up the run files for
the service and its log.  Make sure that the run files are

/var/service/`service'/run
/var/service/`service'/log/run

For example, to set up the run files for dnscache, you would run
something like

dnscache-config dnscache dtlog /var/service/dnscache

If the run files are already set up at a different location, you need
to make a link in /var/service.  For example, 
  
ln -s /public/httpd /var/service

Once the run files are in the correct location, just run
add-service.sh as above.

For a service of the third kind, say linuxconf (I have no idea if you can
run linuxconf from a run file), once you set up the runfiles, you put an
entry of the form

linuxconf:2,3,4,5:

in the file /var/service/dt-run/dt-list.  This says, 

-- the service's name is `linuxconf'; 

-- linuxconf should be run at runlevels 2, 3, 4, 5

-- linuxconf does not depend on other services for startup (this is
   why you do not see anything after the last colon `:').

Now you can run add-service.sh.

WARNING: add-service.sh and remove-service.sh do not enable/disable
	 services for inetd anymore; you have to do this by hand.
	 This is because many Linuces support xinetd, and I am not
	 sure at this point if I can reliably deal with inetd/xinetd
	 anymore.
