data.cdb missing
Paul Baumgardner <[email protected]>
| Newsgroups | gmane.network.djbdns |
|---|---|
| Message-ID | <[email protected]> |
Hello, Have a situation where it appears our data.cdb file went missing and thus was deleted from all of our name servers. Here's a brief overview: Our name servers pull data.cdb from a central rsync server that we make our changes on. It pulls the file every 10 minuets. I made some DNS additions to two of our zone files and ran make. make appeared to run properly as it outputted the changes. 6 minutes later our name servers tried to rsync the file over but the cron job that does started complaining that it could not find the file. The cron mail said this: 'link_stat /usr/local/rsync/tinydns/root/data.cdb : No such file or directory rsync error: some files could not be transferred (code 23) at main.c(636)' We have another cron job that runs at 56 minutes past each hour on our name servers. Here is are the entries in our cron: # every ten minutes copy over the main data file 10-50/10 * * * * root /usr/bin/rsync -qa -e ssh [email protected]:/usr/local/rsync/tinydns/root/data.cdb /var/services/tinydns/root/data.cdb # every hour copy over the entire directory 56 * * * * root /usr/bin/rsync -qa --delete -e ssh [email protected]:/usr/local/rsync/tinydns/ /var/services/tinydns --exclude *env --exclude *.bak So, since I'm pretty sure I ran a successful make - make completed and I have the partial out showing the updates to data.. I'm unsure as to what could have caused the data.cdb file to be missing. Here is our Makefile: ############################### LOCK=$(shell test -f .lock && echo true) data.cdb: data ifeq ($(LOCK),true) @echo Lockfile found -- Someone else is currently running make. else @echo Creating lockfile. @touch .lock cp data data.bak echo > data cat `ls */*.data` >> data @echo "$(shell date) - $(LOGNAME)($(SUDO_USER))" >> /usr/local/rsync/tinydns/root/makelog /usr/bin/tinydns-data chmod 664 data.cdb touch --date="4 minutes ago" data.cdb date @echo removing lockfile. @rm .lock @echo Listing out data files ls -aln data* diff data.bak data || true # Check for duplicate CNAMES @echo "Checking for duplicate CNAMEs..." # @grep '^C' data | grep ':EX$$' | cut -f1 -d: | sort | uniq -c | grep -v '^ 1' || true # @grep '^C' data | grep ':IN$$' | cut -f1 -d: | sort | uniq -c | grep -v '^ 1' || true @grep '^C' data | grep ':EX$$' | grep -v 4000000 | cut -f1 -d: | sed -e 's/\.$$//' | sort | uniq -ci | grep -v '^ 1' || true @grep '^C' data | grep ':IN$$' | grep -v 4000000 | cut -f1 -d: | sed -e 's/\.$$//' | sort | uniq -ci | grep -v '^ 1' || true @grep '^C' data | grep -v ':IN$$' | grep -v ':EX$$' | grep -v 4000000 | cut -f1 -d: | sed -e 's/\.$$//' | sort | uniq -ci | grep -v '^ 1' || true @echo "Done checking for duplicate CNAMEs." endif ######################################### So I'm pretty sure there is no way for the Makefile to remove the data.cdb file. Even if tinydns-data fails, it will revert back to old data.cdb file. Is there anything else that could remove the data.cdb file? I've thousands of makes and have never seen a data.cdb file not getting created. Any thoughts are appreciated.