summaryrefslogtreecommitdiff
path: root/pcr/ganglia/ganglia.install
blob: 6a196af1f990399e2c07115b87ba83d8cee11ecd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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.'
}