Ganglia provides a complete real-time monitoring and execution environment that is in use by hundreds of universities, private and government laboratories and commercial cluster implementors around the world. Whether you want to monitor hundreds of computers in real-time across a university campus or around the world, ganglia is for you. PR: ports/48551 Submitted by: Brooks Davis <brooks@freebsd.org>
37 lines
782 B
Bash
37 lines
782 B
Bash
#!/bin/sh
|
|
|
|
u=ganglia
|
|
g=ganglia
|
|
ugid=97
|
|
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
|
|
|
|
mkdir -p ${rrd_rootdir}
|
|
chown -R ${u}:${g} ${rrd_rootdir}
|
|
;;
|
|
esac
|