X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=zabbix.spec;h=e32fcff038b42f3b0a35ba2a2723114adc1728bc;hb=50f748a465f7c5da3bfbc6523ad9a079006c7861;hp=fb7cb8c1dcddf5999239decd77261cb92d24d3c7;hpb=db36c6a591fdbd5377f6b6c1f4a97342c30d2de3;p=monitor.git diff --git a/zabbix.spec b/zabbix.spec index fb7cb8c..e32fcff 100644 --- a/zabbix.spec +++ b/zabbix.spec @@ -170,11 +170,15 @@ sed -e "s#BASEDIR=/opt/zabbix#BASEDIR=%{_prefix}#g" \ -e "s#PIDFILE=/var/tmp/zabbix_agentd.pid#PIDFILE=%{zabbix_piddir}/zabbix_agentd.pid#g" \ %{zabbix_initdir}/zabbix_agentd > $TMP_FILE cat $TMP_FILE > %{zabbix_initdir}/zabbix_agentd -# TODO: copy to /etc/init.d/ + +# NOTE: Run every runlevel as soon as possible, and stop as late as possible cp %{zabbix_initdir}/zabbix_agentd %{_initrddir} +sed -i -e "s#chkconfig: - 90 10#chkconfig: 2345 12 90#g" \ + %{_initrddir}/zabbix_agentd rm -f $TMP_FILE +chkconfig --add zabbix_agentd chkconfig zabbix_agentd on %post server @@ -195,6 +199,7 @@ TMP_FILE=`mktemp $TMPDIR/zbxtmpXXXXXX` sed -e "s#AlertScriptsPath=/home/zabbix/bin/#AlertScriptsPath=%{zabbix_bindir}/#g" \ -e "s#PidFile=/var/tmp/zabbix_server.pid#PidFile=%{zabbix_piddir}/zabbix_server.pid#g" \ -e "s#LogFile=/tmp/zabbix_server.log#LogFile=%{zabbix_logdir}/zabbix_server.log#g" \ + -e "s|#DBPassword|DBPassword|g" \ %{zabbix_confdir}/zabbix_server.conf > $TMP_FILE cat $TMP_FILE > %{zabbix_confdir}/zabbix_server.conf mkdir -p %{_sysconfdir}/zabbix @@ -204,10 +209,14 @@ sed -e "s#BASEDIR=/opt/zabbix#BASEDIR=%{_prefix}#g" \ -e "s#PIDFILE=/var/tmp/zabbix_server.pid#PIDFILE=%{zabbix_piddir}/zabbix_server.pid#g" \ %{zabbix_initdir}/zabbix_server > $TMP_FILE cat $TMP_FILE > %{zabbix_initdir}/zabbix_server -cp %{zabbix_initdir}/zabbix_server %{_initrddir} - rm -f $TMP_FILE +# NOTE: Run every runlevel as soon as possible, and stop as late as possible +cp %{zabbix_initdir}/zabbix_server %{_initrddir} +sed -i -e "s#chkconfig: - 90 10#chkconfig: 2345 12 90#g" \ + %{_initrddir}/zabbix_server + +chkconfig --add zabbix_server chkconfig zabbix_server on %post gui