diff options
author | Nicolás Reynolds <fauno@parabola.nu> | 2013-06-17 14:24:55 -0300 |
---|---|---|
committer | Nicolás Reynolds <fauno@parabola.nu> | 2013-06-17 14:24:55 -0300 |
commit | 7a843b9d9cca3b4b8a692c4eacc27e28666423a2 (patch) | |
tree | 2cdfc9942731a8878681202fdee0498ff29df5be /pcr/ganglia/ganglia.install | |
parent | 7daeae8ee78e7c78585a5625bcc78f4cddaedb8e (diff) | |
download | abslibre-7a843b9d9cca3b4b8a692c4eacc27e28666423a2.tar.gz abslibre-7a843b9d9cca3b4b8a692c4eacc27e28666423a2.tar.bz2 abslibre-7a843b9d9cca3b4b8a692c4eacc27e28666423a2.zip |
ganglia upgrade (using aur pkgbuild)
Diffstat (limited to 'pcr/ganglia/ganglia.install')
-rw-r--r-- | pcr/ganglia/ganglia.install | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/pcr/ganglia/ganglia.install b/pcr/ganglia/ganglia.install new file mode 100644 index 000000000..60b7f102d --- /dev/null +++ b/pcr/ganglia/ganglia.install @@ -0,0 +1,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: |