I've only been into storing food in bulk for about 18 months, so there are lots of folks out there who have more experience and good ideas. Thanks to those of you who've shared them here.
The trend among those I "pen-pal" with over the Net and talk to in person is to freeze the rice/flour/meal for a week or so, then let it defrost and dry out for a few days, then go into an airtight container with some kind of dessicant. Others use some kind of oxygen-absorbers as well. A cupfull of CLEAN catlitter in a lidless container will work as a dessicant for a 5-gallon bucket. That's what has worked for me, so far. I open the containers every now & then for a short time to remove a 5-lb bag or replace one I've used, and the adult bugs haven't had time to find the opening yet.
Personally, I'm going to try the 2-liter bottle with "squeeze-created" partial vacuum, next. I have a bunch of those on hand that I scavenged for a science project. They'll also store easily in the nooks and crannies.
Homefolks in my area have used the leather-britches approach for pinto beans as well as green beans.