From 1dff07bbd02451f0d29ba9d5cfd6859be77f70df Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Mon, 4 Jan 2021 23:19:55 +0100 Subject: [PATCH] - (un)register server and proxy services on (un)install --- zabbix.spec | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/zabbix.spec b/zabbix.spec index 577c175..e6a4765 100644 --- a/zabbix.spec +++ b/zabbix.spec @@ -413,7 +413,15 @@ EOF fi ln -sf %{_sbindir}/zabbix_server-postgresql %{_sbindir}/zabbix_server || : +%post server +/sbin/chkconfig --add zabbix_server +%service zabbix_server restart + %postun server +if [ "$1" = "0" ]; then + %service -q zabbix_server stop + /sbin/chkconfig --del zabbix_server +fi if [ "$1" = "0" ]; then if [ -L %{_sbindir}/zabbix_server ] ; then rm -f %{_sbindir}/zabbix_server || : @@ -439,6 +447,21 @@ ln -sf %{_sbindir}/zabbix_proxy-postgresql %{_sbindir}/zabbix_proxy || : %post proxy-sqlite3 ln -sf %{_sbindir}/zabbix_proxy-sqlite3 %{_sbindir}/zabbix_proxy || : +%post proxy +/sbin/chkconfig --add zabbix_server +%service zabbix_server restart + +%postun proxy +if [ "$1" = "0" ]; then + %service -q zabbix_proxy stop + /sbin/chkconfig --del zabbix_proxy +fi +if [ "$1" = "0" ]; then + if [ -L %{_sbindir}/zabbix_proxy ] ; then + rm -f %{_sbindir}/zabbix_proxy || : + fi +fi + %files %defattr(644,root,root,755) %doc AUTHORS ChangeLog README -- 2.46.0