# Source0-md5: e0798bb1b53ab7b451556dc34c3b1827
Source1: %{name}-apache.conf
Source2: %{name}_agentd.init
+Source3: %{name}_server.init
+Source4: %{name}_proxy.init
Patch0: tld.patch
Patch1: sqlite3_dbname.patch
Patch2: always_compile_ipc.patch
cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/zabbix_agentd
+install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/zabbix_server
+install %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/zabbix_proxy
mv $RPM_BUILD_ROOT%{_appdir}/ui/conf $RPM_BUILD_ROOT%{_sysconfdir}/web
ln -s %{_sysconfdir}/web $RPM_BUILD_ROOT%{_appdir}/ui/conf
%defattr(644,root,root,755)
%attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_proxy.conf
%dir %attr(751,root,zabbix) %{_sysconfdir}/zabbix_proxy.conf.d
+%attr(754,root,root) /etc/rc.d/init.d/zabbix_proxy
%ghost %attr(755,root,root) %{_sbindir}/zabbix_proxy
%{_mandir}/man8/zabbix_proxy*
%endif
%defattr(644,root,root,755)
%attr(640,root,zabbix) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zabbix_server.conf
%dir %attr(751,root,zabbix) %{_sysconfdir}/zabbix_server.conf.d
+%attr(754,root,root) /etc/rc.d/init.d/zabbix_server
%ghost %attr(755,root,root) %{_sbindir}/zabbix_server
%{_mandir}/man8/zabbix_server*
%endif
--- /dev/null
+#!/bin/sh
+#
+# Starts the zabbix_proxy daemon
+#
+# chkconfig: 345 95 5
+#
+# description: zabbix_proxy long service description
+#
+# processname: zabbix_proxy
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+ if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+ msg_network_down "Zabbix Proxy"
+ exit 1
+ fi
+else
+ exit 0
+fi
+
+# Get service config - may override defaults
+[ -f /etc/sysconfig/zabbix_proxy ] && . /etc/sysconfig/zabbix_proxy
+
+pidfile="/var/run/zabbix/zabbix_proxy.pid"
+
+start() {
+ # Check if the service is already running?
+ if [ -f /var/lock/subsys/zabbix_proxy ]; then
+ msg_already_running "Zabbix Proxy"
+ return
+ fi
+
+ msg_starting "Zabbix Proxy"
+ daemon /usr/sbin/zabbix_proxy
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/zabbix_proxy
+}
+
+stop() {
+ if [ ! -f /var/lock/subsys/zabbix_proxy ]; then
+ msg_not_running "Zabbix Proxy"
+ return
+ fi
+
+ # Stop daemons.
+ msg_stopping "Zabbix Proxy"
+ killproc --pidfile $pidfile zabbix_proxy -TERM
+ rm -f /var/lock/subsys/zabbix_proxy
+}
+
+condrestart() {
+ if [ ! -f /var/lock/subsys/zabbix_proxy ]; then
+ msg_not_running "Zabbix Proxy"
+ RETVAL=$1
+ return
+ fi
+
+ stop
+ start
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ try-restart)
+ condrestart 0
+ ;;
+ force-reload)
+ condrestart 7
+ ;;
+ status)
+ status --pidfile $pidfile zabbix_proxy
+ RETVAL=$?
+ ;;
+ *)
+ msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
+ exit 3
+esac
+
+exit $RETVAL
--- /dev/null
+#!/bin/sh
+#
+# Starts the zabbix_server daemon
+#
+# chkconfig: 345 95 5
+#
+# description: zabbix_server long service description
+#
+# processname: zabbix_server
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+ if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+ msg_network_down "Zabbix Server"
+ exit 1
+ fi
+else
+ exit 0
+fi
+
+# Get service config - may override defaults
+[ -f /etc/sysconfig/zabbix_server ] && . /etc/sysconfig/zabbix_server
+
+pidfile="/var/run/zabbix/zabbix_server.pid"
+
+start() {
+ # Check if the service is already running?
+ if [ -f /var/lock/subsys/zabbix_server ]; then
+ msg_already_running "Zabbix Server"
+ return
+ fi
+
+ msg_starting "Zabbix Server"
+ daemon /usr/sbin/zabbix_server
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/zabbix_server
+}
+
+stop() {
+ if [ ! -f /var/lock/subsys/zabbix_server ]; then
+ msg_not_running "Zabbix Server"
+ return
+ fi
+
+ # Stop daemons.
+ msg_stopping "Zabbix Server"
+ killproc --pidfile $pidfile zabbix_server -TERM
+ rm -f /var/lock/subsys/zabbix_server
+}
+
+condrestart() {
+ if [ ! -f /var/lock/subsys/zabbix_server ]; then
+ msg_not_running "Zabbix Server"
+ RETVAL=$1
+ return
+ fi
+
+ stop
+ start
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ try-restart)
+ condrestart 0
+ ;;
+ force-reload)
+ condrestart 7
+ ;;
+ status)
+ status --pidfile $pidfile zabbix_server
+ RETVAL=$?
+ ;;
+ *)
+ msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
+ exit 3
+esac
+
+exit $RETVAL