PgCluu init.d script

As root, save this script as /etc/init.d/pgcluu.

As postgres:
- Install pgcluu: 
git clone https://github.com/darold/pgcluu

- Create a directory to hold the sar etc output:
mkdir -p ~postgres/pgcluu_collectd_stats

- Create a directory for the generated results:
mkdir -p $(echo ~postgres)/pgcluu_generated_results

As root:
- Add a symlink from the pgcluu_collectd executable to /usr/bin/
ln -s /path/to/pgcluu_collectd /usr/bin/pgcluu

- Make it widely executable
chmod 755 /etc/init.d/pgcluu

- Add to chkconfig (if chkconfig is installed) for easy start/stop/restart
chkconfig --add pgcluu
chkconfig pgcluu on


- Start/stop/restart:
service pgcluu (start|stop|restart)

- As postgres, sample execution:
time pgcluu --output=$(echo ~postgres)/pgcluu_generated_results $(echo ~postgres)/pgcluu_collectd_stats