bsdperimeter/pfsense-packages — pull request #390 by phildd (2013-03-01 10:19:07+00:00)
Title: bandwidthd for nanobsd in /var/bandwidthd

This change makes bandwidthd run on nanobsd. The files written in real-time are on the /var memory filesystem:
/var/bandwidthd contains:
bandwidthd - a soft link to the real bandwidthd program
etc - a soft link to the real etc dir that has bandwidthd.conf in it
htdocs - a real dir in which the graph files are written at run time
log.1.0.cdf - the data file that is written when output_cdf is enabled and read back when recover_cdf is enabled.

Note: The previous version ran bandwidthd like this:
"/usr/local/bandwidthd/bandwidthd {$bandwidthd_config_dir}/bandwidthd.conf"
the parameter to bandwidthd is completely unused by bandwidthd - bandwidthd always looks in ./etc/bandwidthd.conf for its config, there is no way to pass it a parameter like this, it is simply ignored. So I have removed the parameter to improve future understanding.

bandwidthd runs nicely on nanobsd with the CF card filesystems mounted read-only. It can be restarted and preserves the previous data if output_cdf and recover_cdf are set in the GUI/config.

So far I have not added an option to save the log.n.n.cdf files to permanent storage. So the data is lost on reboot - that is no worse than the situation now, where it does not run at all! I will work on that at the weekend. But for now, I think this is a useful point to get to.