Bug 195081 - Some net-mgmt/zabbix* ports need rcorder dependency on their database
Summary: Some net-mgmt/zabbix* ports need rcorder dependency on their database
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Kurt Jaeger
URL:
Keywords: patch, patch-ready
Depends on:
Blocks:
 
Reported: 2014-11-16 20:24 UTC by Christian Ullrich
Modified: 2014-12-27 14:53 UTC (History)
2 users (show)

See Also:


Attachments
Patch (2.21 KB, patch)
2014-12-27 11:33 UTC, Christian Ullrich
chris: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Ullrich 2014-11-16 20:24:16 UTC
The Zabbix server and proxy ports require a database to run. They currently support four, PostgreSQL, Oracle, SQLite, and MySQL. As of now, rcorder puts them ahead of the database ports, so they spit out dozens of error messages during startup and, worse, get the database pulled out from under them during shutdown.

The ports used to provide a solution for this, by defining ZABBIX_REQUIRE. The value of this variable used to be added to the REQUIRE lines in the startup scripts, but this was removed accidentally from 2.2 in r355546 and never existed in 2.4. This patch adds it back, in a slightly different, optionsng-friendly way.

One possible issue with this fix is that if the database is not on the same system, there is a dangling dependency (which will, however, be ignored by rc). This has also been true before the feature was removed from the port.



diff -urN net-mgmt/zabbix22-server.orig/files/zabbix_proxy.in net-mgmt/zabbix22-server/files/zabbix_proxy.in
--- net-mgmt/zabbix22-server.orig/files/zabbix_proxy.in 2014-11-16 20:13:43.000000000 +0100
+++ net-mgmt/zabbix22-server/files/zabbix_proxy.in      2014-11-16 20:33:13.000000000 +0100
@@ -1,7 +1,9 @@
 #!/bin/sh

 # PROVIDE: zabbix_proxy
-# REQUIRE: DAEMON%%ZABBIX_REQUIRE%%
+# REQUIRE: DAEMON
+%%PGSQL%%# REQUIRE: postgresql
+%%MYSQL%%# REQUIRE: mysql-server
 # KEYWORD: shutdown
 #
 # Add the following lines to /etc/rc.conf.local or /etc/rc.conf to
diff -urN net-mgmt/zabbix22-server.orig/files/zabbix_server.in net-mgmt/zabbix22-server/files/zabbix_server.in
--- net-mgmt/zabbix22-server.orig/files/zabbix_server.in        2014-11-16 20:13:43.000000000 +0100
+++ net-mgmt/zabbix22-server/files/zabbix_server.in     2014-11-16 21:08:02.000000000 +0100
@@ -1,7 +1,9 @@
 #!/bin/sh

 # PROVIDE: zabbix_server
-# REQUIRE: DAEMON%%ZABBIX_REQUIRE%%
+# REQUIRE: DAEMON
+%%PGSQL%%# REQUIRE: postgresql
+%%MYSQL%%# REQUIRE: mysql-server
 # KEYWORD: shutdown
 #
 # Add the following lines to /etc/rc.conf.local or /etc/rc.conf to
diff -urN net-mgmt/zabbix24-server.orig/files/zabbix_proxy.in net-mgmt/zabbix24-server/files/zabbix_proxy.in
--- net-mgmt/zabbix24-server.orig/files/zabbix_proxy.in 2014-11-16 20:44:19.000000000 +0100
+++ net-mgmt/zabbix24-server/files/zabbix_proxy.in      2014-11-16 20:45:30.000000000 +0100
@@ -1,7 +1,9 @@
 #!/bin/sh

 # PROVIDE: zabbix_proxy
-# REQUIRE: DAEMON%%ZABBIX_REQUIRE%%
+# REQUIRE: DAEMON
+%%PGSQL%%# REQUIRE: postgresql
+%%MYSQL%%# REQUIRE: mysql-server
 # KEYWORD: shutdown
 #
 # Add the following lines to /etc/rc.conf.local or /etc/rc.conf to
diff -urN net-mgmt/zabbix24-server.orig/files/zabbix_server.in net-mgmt/zabbix24-server/files/zabbix_server.in
--- net-mgmt/zabbix24-server.orig/files/zabbix_server.in        2014-11-16 20:44:19.000000000 +0100
+++ net-mgmt/zabbix24-server/files/zabbix_server.in     2014-11-16 20:45:00.000000000 +0100
@@ -1,7 +1,9 @@
 #!/bin/sh

 # PROVIDE: zabbix_server
-# REQUIRE: DAEMON%%ZABBIX_REQUIRE%%
+# REQUIRE: DAEMON
+%%PGSQL%%# REQUIRE: postgresql
+%%MYSQL%%# REQUIRE: mysql-server
 # KEYWORD: shutdown
 #
 # Add the following lines to /etc/rc.conf.local or /etc/rc.conf to
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2014-11-20 04:08:58 UTC
Notify maintainer.
Comment 2 pg 2014-12-09 07:34:16 UTC
Hello,
I approve this patch.
Thanks!
Comment 3 John Marino freebsd_committer freebsd_triage 2014-12-09 17:20:25 UTC
patch was approved by maintainer, set "patch-ready' keyword.
Comment 4 Christian Ullrich 2014-12-27 11:33:52 UTC
Created attachment 150984 [details]
Patch
Comment 5 commit-hook freebsd_committer freebsd_triage 2014-12-27 14:53:01 UTC
A commit references this bug:

Author: pi
Date: Sat Dec 27 14:52:37 UTC 2014
New revision: 375683
URL: https://svnweb.freebsd.org/changeset/ports/375683

Log:
  net-mgmt/zabbix2[24]-server: fix zabbix and database startup sequence

  The Zabbix server and proxy ports require a database to run. They
  currently support four, PostgreSQL, Oracle, SQLite, and MySQL. As
  of now, rcorder puts them ahead of the database ports, so they spit
  out dozens of error messages during startup and, worse, get the
  database pulled out from under them during shutdown.

  The ports used to provide a solution for this, by defining
  ZABBIX_REQUIRE. The value of this variable used to be added to the
  REQUIRE lines in the startup scripts, but this was removed accidentally
  from 2.2 in r355546 and never existed in 2.4. This patch adds it
  back, in a slightly different, optionsng-friendly way.

  PR:		195081
  Submitted by:	chris@chrullrich.net
  Approved by:	pakhom706@gmail.com (maintainer)

Changes:
  head/net-mgmt/zabbix22-server/files/zabbix_proxy.in
  head/net-mgmt/zabbix22-server/files/zabbix_server.in
  head/net-mgmt/zabbix24-server/files/zabbix_proxy.in
  head/net-mgmt/zabbix24-server/files/zabbix_server.in
Comment 6 Kurt Jaeger freebsd_committer freebsd_triage 2014-12-27 14:53:28 UTC
Committed, thanks.