Etc-tcp-makefile
From Qmail Info Wiki
This page demonstrates how I use "make" to automate the updating of cdb files produced by tcprules and used by tcpserver to control access to the various services on my server.
I have a directory on my server called "/etc/tcp", which contains a "Makefile" along with the various text files I use to set up the access lists, and the cdb files which are actually used by tcpserver.
The contents of my Makefile:
# list of .cdb files to be built by this Makefile
all: ftp.cdb smtp.cdb
%.cdb: %
tcprules $@ $*.tmp < $*
chmod 644 $@ $*
I maintain two text files called "ftp" and "smtp" in the same directory. Whenever I change one or both of them, I simply type "make" and it updates the cdb files automatically. If I need to add any more services, I edit the "all:" line in the Makefile to include the name of the cdb file, and then I can create or edit the text file (which is the name of the cdb file, without the ".cdb" at the end) and running "make" works just as well as it does for the existing services.
The permissions on the /etc/tcp directory should be 0755, and the permissions on the files within the directory should be 0644. This command will correctly set all of the permissions:
chmod -R go=u-w /etc/tcp
John Simpson 2005-09-17

