I have learned (too) much about amrecover in the past day or so. My adventure started when I decided to test restores from amanda -after all, what good is backup without the ability to restore? The problem started right from the get-go:

Screen clipping taken: 18/11/2005, 15:07
Silent failure. I hate silent failures. I spent the better part of two hours trying command line variations in a futile attempt to get amrecover to hint at the problem. I then started trying some more systematic troubleshooting steps.
Debug amrecover, Step 1: First, I examined the amanda log files, which are usually pretty good. You first need to find the proper log file, which requires sorting the log files by time and getting the latest relevant log file (ls -lrt). In this case, we are looking into the amrecover utility and so the log files (in /var/log/amanda) are named amrecover ..debug:

Screen clipping taken: 18/11/2005, 15:21
As expected we see that amrecover is trying to contact the server on triumph. I learned that amrecover trys to open a TCP connection to the amanda index daemon on port 10082.
Debug amrecover, Step 2: OK, I’ll telnet to that port and see if it is listening:

Screen clipping taken: 18/11/2005, 15:09
Interesting. I was making it through the three (!) firewalls to triumph, who was promptly shutting the door in my face. Sounds like a server problem…
Debug amrecover, Step 3: Over on the server, double check if anybody is listening on port 10082:

Screen clipping taken: 18/11/2005, 15:24
Yup, xinetd is listening. But is it starting the amanda index program correctly?
Debug amrecover, Step 4: Check the contents of the xinetd configuration file (/etc/xinetd.d/amandaidx):

Screen clipping taken: 18/11/2005, 15:26
All looks good here.
Debug amrecover, Step 5: Next step, check out the amanda log files on the server for amindexd:

Screen clipping taken: 18/11/2005, 15:30
While not obviously a fatal error, this “Socket operation on non-socket” does not look good. Plus, I can see that amindexd ran for only about a second. Now I am starting to smell smoke. In more detail, it seems that amindexd called the getpeername function, which failed. Reading the man page for getpeername shows that it takes a socket for an argument. Is amindexd passing getpeername a bad argument? At this point, I hit a brick wall -it would seem that I would need to start amindexd in a debugger -but that is not an option.
Out of the blue, I decide to look at the audit logs for selinux. Bingo! For the conclusion of this exercise, see the selinux section of this site.