summaryrefslogtreecommitdiff
path: root/pcr/ganglia/ganglia.install
blob: 60b7f102d7fd1f58e4301cff25eadf8c218b60ad (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
25
26
27
28
29
30
31
32
# arg 1:  the new package version
post_install() {
  post_upgrade
}

# arg 1:  the new package version
# arg 2:  the old package version
post_upgrade() {
  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
}

# arg 1:  the old package version
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."
}

# vim:set ts=2 sw=2 et: