PCP_LOG_DIR=/var/log/pcp
PCP_PMNS_DIR=/var/lib/pcp/pmns
# restore saved configs, if any
test -s "$PCP_LOG_DIR/configs.sh" && source "$PCP_LOG_DIR/configs.sh"
rm -f $PCP_LOG_DIR/configs.sh
touch "$PCP_PMNS_DIR/.NeedRebuild"
chmod 644 "$PCP_PMNS_DIR/.NeedRebuild"
/usr/sbin/post_service pmproxy
cd $PCP_PMNS_DIR && ./Rebuild -s && rm -f .NeedRebuild