Setting up Amanda server/client with daemontools

Amanda is an excellent backup software. You can read more about it at Amanda home page.

Here is the recipe for those who (like me) prefer using Dan Berstein's daemontools instead of (x)inetd, for controlling system services on UNIX machines.

Assumptions:

Tape Server Host

To enable full capabilities of Amanda (indexing/recovery), we need two services at the tape server host:

Create service directories

mkdir -p /etc/amanda/supervise/amindex
mkdir -p /etc/amanda/supervise/amidxtape

Create service startup files and make them executable

:::::::::::::: /etc/amanda/supervise/amindex/run ::::::::::::::
#!/bin/sh
exec /usr/local/bin/setuidgid amanda \
 /usr/local/bin/tcpserver -DHRl0 0 10082 \
 /usr/local/libexec/amindexd >/dev/null 2>/dev/null

:::::::::::::: /etc/amanda/supervise/amidxtape/run ::::::::::::::
#!/bin/sh
exec /usr/local/bin/setuidgid amanda \
 /usr/local/bin/tcpserver -DHRl0 0 10083 \
 /usr/local/libexec/amidxtaped >/dev/null 2>/dev/null

Link service directories into your svscan directory

cd /service
ln -s /etc/amanda/supervise/amandaidx .
ln -s /etc/amanda/supervise/amidxtape .

Client Hosts

Amanda client hosts are listening on UDP port 10080, amandad program handles the connections.
We're setting up one service, called simply amanda.

Create service directory

mkdir -p /etc/amanda/supervise/amanda

Create service startup file and make it executable

:::::::::::::: /etc/amanda/supervise/amanda/run ::::::::::::::
#!/bin/sh
exec /usr/local/bin/setuidgid amanda \
/usr/bin/nc -l -u -p 10080 -q 0 \
-e /usr/local/libexec/amandad >/dev/null 2>/dev/null

Link service directory into your svscan directory

cd /service
ln -s /etc/amanda/supervise/amanda .