Move vnstat database to /var/log/rrd

Add a tmpfs script to restore the ramdisk before network start and save after
This commit is contained in:
Arne Fitzenreiter
2008-10-02 00:59:48 +02:00
parent 2cc86a2a13
commit d34d9f3b16
8 changed files with 48 additions and 11 deletions

View File

@@ -24,12 +24,6 @@ case "$1" in
fi
fi
/etc/init.d/collectd restore
if [ ! -e $RRDLOG.bak/ ]; then
mkdir $RRDLOG.bak/
fi
boot_mesg -n "Loading Sensor Modules..."
for modul in `cat /etc/sysconfig/lm_sensors | grep '^MODULE_' | cut -d"=" -s -f2`; do
modprobe $modul > /dev/null 2>&1;
@@ -47,7 +41,10 @@ case "$1" in
evaluate_retval
;;
stop)
/etc/init.d/collectd backup
# Save the ramdisk at manual stop but not at shutdown
if [ "$(basename $0)" == "collectd" ]; then
/etc/init.d/collectd backup
fi
boot_mesg "Stopping Collection daemon..."
killproc /usr/sbin/collectd
evaluate_retval

View File

@@ -0,0 +1,31 @@
#!/bin/sh
# Begin $rc_base/init.d/tmpfs
. /etc/sysconfig/rc
. $rc_functions
eval $(/usr/local/bin/readhash /var/ipfire/main/settings)
if [ "$RRDLOG" = '' ]; then
RRDLOG=/var/log/rrd
fi
case "$1" in
start)
/etc/init.d/collectd restore
if [ ! -e $RRDLOG.bak/vnstat ]; then
mkdir -p $RRDLOG.bak/vnstat
fi
;;
stop)
/etc/init.d/collectd backup
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
;;
esac
# End $rc_base/init.d/tmpfs