2008-05-17 17:43:49 +00:00
|
|
|
#!/bin/sh /etc/rc.common
|
2008-06-02 01:49:51 +00:00
|
|
|
START=79
|
2008-05-17 17:43:49 +00:00
|
|
|
|
|
|
|
start() {
|
2008-06-02 01:49:51 +00:00
|
|
|
### replace shipped config with symlink
|
|
|
|
if [ ! -L /etc/collectd.conf ]; then
|
|
|
|
test -f /etc/collectd.conf && mv /etc/collectd.conf /etc/collectd.conf.bak
|
|
|
|
ln -s /var/etc/collectd.conf /etc/collectd.conf
|
|
|
|
fi
|
2008-05-17 17:43:49 +00:00
|
|
|
|
2008-06-02 01:49:51 +00:00
|
|
|
### create config
|
|
|
|
mkdir -p /var/etc
|
|
|
|
/usr/bin/stat-genconfig > /var/etc/collectd.conf
|
2008-05-17 17:43:49 +00:00
|
|
|
|
2008-06-02 01:49:51 +00:00
|
|
|
### prepare rrdimg directory
|
2010-02-28 20:59:23 +00:00
|
|
|
if [ -f /etc/config/lucid ] && [ -x /etc/init.d/lucid ] && /etc/init.d/lucid enabled && \
|
|
|
|
[ "$(uci get luci_statistics.rrdtool.image_path 2>/dev/null)" != "$(uci get lucid.statistics.physical 2>/dev/null)" ]; then
|
|
|
|
uci set lucid.statistics.physical=$(uci get luci_statistics.rrdtool.image_path)
|
2009-06-27 15:24:58 +00:00
|
|
|
uci commit lucid
|
|
|
|
/etc/init.d/lucid restart
|
2008-06-02 01:49:51 +00:00
|
|
|
fi
|
2008-10-29 03:59:37 +00:00
|
|
|
|
2009-02-16 17:43:43 +00:00
|
|
|
### workaround broken permissions on /tmp
|
|
|
|
chmod 1777 /tmp
|
2008-06-02 01:49:51 +00:00
|
|
|
}
|
2008-06-08 21:59:51 +00:00
|
|
|
|
|
|
|
restart() {
|
2009-02-16 17:43:43 +00:00
|
|
|
### regenerate config / prepare environment
|
|
|
|
start
|
2008-06-08 21:59:51 +00:00
|
|
|
|
2009-02-16 17:43:43 +00:00
|
|
|
### restart collectd
|
|
|
|
/etc/init.d/collectd restart
|
2008-06-08 21:59:51 +00:00
|
|
|
}
|