diff options
Diffstat (limited to 'network/zabbix_agentd/zabbix_agentd.SlackBuild')
-rw-r--r-- | network/zabbix_agentd/zabbix_agentd.SlackBuild | 42 |
1 files changed, 27 insertions, 15 deletions
diff --git a/network/zabbix_agentd/zabbix_agentd.SlackBuild b/network/zabbix_agentd/zabbix_agentd.SlackBuild index f91eeede75..5c8de89178 100644 --- a/network/zabbix_agentd/zabbix_agentd.SlackBuild +++ b/network/zabbix_agentd/zabbix_agentd.SlackBuild @@ -2,7 +2,7 @@ # Slackware build script for zabbix_agentd -# Copyright 2012 Michal Bialozor, Gdansk, POLAND +# Copyright 2013 Michal Bialozor, Gdansk, Pomorskie, POLAND # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -23,7 +23,7 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. PRGNAM=zabbix_agentd -VERSION=${VERSION:-1.8.16} +VERSION=${VERSION:-2.0.6} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} @@ -37,10 +37,15 @@ fi PRGSHORT=zabbix -ZABBIXUSER=${ZABBIXUSER:-zabbixagent} -ZABBIXGROUP=${ZABBIXGROUP:-zabbixagent} -ZABBIXUID=${ZABBIXUID:-266} -ZABBIXGID=${ZABBIXGID:-266} +ZABBIXUSER=${ZABBIXUSER:-zabbix} +ZABBIXGROUP=${ZABBIXGROUP:-zabbix} +ZABBIXUID=${ZABBIXUID:-228} +ZABBIXGID=${ZABBIXGID:-228} + +ZABBIXAGENTUSER=${ZABBIXAGENTUSER:-zabbixagent} +ZABBIXAGENTGROUP=${ZABBIXAGENTGROUP:-zabbixagent} +ZABBIXAGENTUID=${ZABBIXAGENTUID:-266} +ZABBIXAGENTGID=${ZABBIXAGENTGID:-266} CWD=$(pwd) TMP=${TMP:-/tmp/SBo} @@ -50,12 +55,14 @@ OUTPUT=${OUTPUT:-/tmp} set -e # Bail out if user or group isn't valid on your system -# For slackbuilds.org, assigned zabbixagent uid/gid are 266/266 +# For slackbuilds.org, assigned zabbixagent uid/gid are 266/266 and assigned zabbix uid/gid are 228/228 # See http://slackbuilds.org/uid_gid.txt -if [ "$(grep ^$ZABBIXUSER: /etc/passwd)" = "" -o "$(grep ^$ZABBIXGROUP: /etc/group)" = "" ] ; then - echo " You must have a \"$ZABBIXGROUP\" group and user to run this script." +if [ "$(grep ^$ZABBIXAGENTUSER: /etc/passwd)" = "" -o "$(grep ^$ZABBIXAGENTUSER: /etc/passwd)" = "" -o \ + "$(grep ^$ZABBIXGROUP: /etc/group)" = "" ] ; then + echo " You must have a \"$ZABBIXGROUP\" group as well as \"$ZABBIXUSER\" and \"$ZABBIXAGENTUSER\" users to run this script." echo " # groupadd -g $ZABBIXGID $ZABBIXGROUP" echo " # useradd -u $ZABBIXUID -g $ZABBIXGROUP -d /dev/null -s /bin/false $ZABBIXUSER" + echo " # useradd -u $ZABBIXAGENTUID -g $ZABBIXGROUP -d /dev/null -s /bin/false $ZABBIXAGENTUSER" exit 1 fi @@ -91,7 +98,7 @@ CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ - --sysconfdir=/etc \ + --sysconfdir=/etc/zabbix \ --localstatedir=/var/lib \ --mandir=/usr/man \ --docdir=/usr/doc/$PRGNAM-$VERSION \ @@ -110,30 +117,35 @@ for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; r # Initial log file mkdir -p $PKG/var/log/$PRGSHORT +chown $ZABBIXUSER:$ZABBIXGROUP $PKG/var/log/$PRGSHORT +chmod g+w $PKG/var/log/$PRGSHORT touch $PKG/var/log/$PRGSHORT/$PRGNAM.log.new -chown -R $ZABBIXUSER:$ZABBIXGROUP $PKG/var/log/$PRGSHORT +chown $ZABBIXAGENTUSER:$ZABBIXUSER $PKG/var/log/$PRGSHORT/$PRGNAM.log.new # Dir for pid-file mkdir -p $PKG/var/run/$PRGSHORT chown -R $ZABBIXUSER:$ZABBIXGROUP $PKG/var/run/$PRGSHORT +chmod g+w $PKG/var/run/$PRGSHORT # Configuration file -mkdir -p $PKG/etc/$PRGSHORT/zabbix_agentd.conf.d sed -e "s,# PidFile=/tmp/,PidFile=/var/run/$PRGSHORT/," \ -e "s,LogFile=/tmp/,LogFile=/var/log/$PRGSHORT/," \ - misc/conf/$PRGNAM.conf > $PKG/etc/$PRGSHORT/$PRGNAM.conf.new + $PKG/etc/$PRGSHORT/$PRGNAM.conf > $PKG/etc/$PRGSHORT/$PRGNAM.conf.new +rm -rf $PKG/etc/$PRGSHORT/zabbix_agent.conf.d $PKG/etc/$PRGSHORT/zabbix_agent.conf \ + $PKG/etc/$PRGSHORT/$PRGNAM.conf # Init script mkdir -p $PKG/etc/rc.d -sed "s|@ZABBIXUSER@|$ZABBIXUSER|" $CWD/rc.$PRGNAM > $PKG/etc/rc.d/rc.$PRGNAM.new +sed "s|@ZABBIXAGENTUSER@|$ZABBIXAGENTUSER|" $CWD/rc.$PRGNAM > $PKG/etc/rc.d/rc.$PRGNAM.new # Documentation mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp -a AUTHORS COPYING ChangeLog CREDITS INSTALL NEWS README \ +cp -a AUTHORS COPYING ChangeLog INSTALL NEWS README \ $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild cat $CWD/README.SLACKWARE > $PKG/usr/doc/$PRGNAM-$VERSION/README.SLACKWARE +# Installation scripts mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/doinst.sh > $PKG/install/doinst.sh |