summaryrefslogtreecommitdiff
path: root/pcr/ganglia/ganglia.install
diff options
context:
space:
mode:
authorShackra Sislock <jorgean@lavabit.com>2013-07-04 21:52:02 -0600
committerShackra Sislock <jorgean@lavabit.com>2013-07-04 21:52:02 -0600
commitcd298e9e8d80d387472058ff4b089f0ee509d644 (patch)
treed00e711db4fa42f10698791204a1e64ba5611f3c /pcr/ganglia/ganglia.install
parent64e1664807a6e37d4fdfc35d271028104b54c4a1 (diff)
parent91bd98130ae07e48bd945b0b87e51a117c29ad6f (diff)
updating my branches
Diffstat (limited to 'pcr/ganglia/ganglia.install')
-rw-r--r--pcr/ganglia/ganglia.install24
1 files changed, 24 insertions, 0 deletions
diff --git a/pcr/ganglia/ganglia.install b/pcr/ganglia/ganglia.install
new file mode 100644
index 000000000..6a196af1f
--- /dev/null
+++ b/pcr/ganglia/ganglia.install
@@ -0,0 +1,24 @@
+post_install() {
+ if [ "`vercmp $2 3.4.0`" -lt 0 ]; then
+ echo 'WARNING: The ganglia package has been split. If you use the' \
+ "web frontend, you'll need to install the ganglia-web package as well."
+ fi
+ id ganglia >& /dev/null
+ if [ $? -ne 0 ]; then
+ echo 'Adding ganglia system group and user...'
+ groupadd -r ganglia && useradd -r -d /var/lib/ganglia -g ganglia -s /bin/false ganglia
+ # Lock the account to prevent logging in
+ passwd -l ganglia &> /dev/null
+ fi
+ install -d -o ganglia -g ganglia /var/lib/ganglia && install -d -o ganglia -g ganglia /var/lib/ganglia/rrds
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ echo 'Removing ganglia system group and user...'
+ userdel ganglia
+ echo 'NOTE: Please remove /var/lib/ganglia manually if it is no longer required.'
+}