freebsd-ports/sysutils/ganglia-monitor-core/files/pkg-install.in
Brooks Davis f018d5629a Upgrade ganglia to 3.0.0.
3.0.0 mostly consists of a more flexable portable gmond which requires a
new config file format.  Information about changes in this release can
be found on the website at:

http://ganglia.info/archives/cat_releases.html

and in ports/UPDATING.
2005-03-01 23:04:37 +00:00

46 lines
1 KiB
Bash

#!/bin/sh
u=ganglia
g=ganglia
ugid=102
homedir=/nonexistent
shell=/sbin/nologin
rrd_rootdir=/var/db/ganglia/rrds
case $2 in
POST-INSTALL)
if pw group show "${g}" >/dev/null 2>&1; then
echo "Using existing group \"${g}\"."
else
echo "Creating group \"${g}\", (gid: ${ugid})."
pw groupadd ${g} -g ${ugid}
if [ $? != 0 ]; then
echo "Failed to add group \"${g}\"."
exit 1
fi
fi
if pw user show "${u}" >/dev/null 2>&1; then
echo "Using existing user \"${u}\"."
else
echo "Creating user \"${u}\", (uid: ${ugid})."
pw useradd ${u} -u ${ugid} -g ${ugid} -h - \
-d ${homedir} -s ${shell} -c "Ganglia User"
if [ $? != 0 ]; then
echo "Failed to add user \"${u}\"."
exit 1
fi
fi
if [ ! -f %%PREFIX%%/etc/gmond.conf ]; then
cp %%PREFIX%%/etc/gmond.conf.sample %%PREFIX%%/etc/gmond.conf
fi
%%GMETAD%% mkdir -p ${rrd_rootdir}
%%GMETAD%% chown -R ${u}:${g} ${rrd_rootdir}
%%GMETAD%%
%%GMETAD%% if [ ! -f %%PREFIX%%/etc/gmetad.conf ]; then
%%GMETAD%% cp %%PREFIX%%/etc/gmetad.conf.sample %%PREFIX%%/etc/gmetad.conf
%%GMETAD%% fi
;;
esac