[CUWiN-Dev] cuw_config_backend questions
David Young
dyoung at pobox.com
Thu Sep 8 16:48:11 CDT 2005
On Thu, Sep 08, 2005 at 11:22:38AM -0500, Bill Comisky wrote:
> I can see that the root filesystem is mounted read/write in
> initialize_config() in /usr/sbin/cuw_config_backend, where it calls
> update_cuw_config_{hostname,nameservers}().
>
> After seeing a smokeping plot of a node rebooting every 5-6 minutes all
> weekend (only one node up, nothing tickling the watchdog) I started
> wondering about flash erase-write cycles (which I admit I know next to
> nothing), and whether the initialize_config() function counted for one at
> every reboot. I've seen estimates of 1e4 to 1e6 erase cycles for flash
> memory. At the low end that's a lifetime of about 35 days if you get an
> erase cycle every 5 minutes, at the high end its closer to 10 years.
>
> Looking again at initialize_config(), I'm not sure why we need need to
> mount -u -w / at all. The only files modified are in /etc or /var which
> are both mfs filesystems.
I am looking at initialize_config() for the first time, myself. I don't
understand why it remounts read-write, either. Some of the subroutines
it calls will also remount read-write.
I would like to see the whole backend redone so that resynchronizing
the non-volatile configuration with the volatile configuration happens
in one place. Something along these lines:
config_files=/etc/cuw_config # et cetera
touch /var/tmp/begin-reconfig
# In POSIX, the timestamp resolution for files
# is 1 second. Wait one second before modifying
# any files, so that find(1) or test(1) can tell
# they have been modified since
# /var/tmp/begin-reconfig was touched.
sleep 1
###
### update configuration
###
mount -u -w /
cd /
find $config_files -newer /var/tmp/begin-reconfig | \
xargs pax -pe -rw /permanent/.
# optionally remount read-only
I believe we will ultimately end up with fewer lines of code by
consolidating the "refresh non-volatile config" function in one place.
Dave
--
David Young OJC Technologies
dyoung at ojctech.com Urbana, IL * (217) 278-3933
More information about the CU-Wireless-Dev
mailing list