Index: head/net-mgmt/zabbix2-server/Makefile =================================================================== --- head/net-mgmt/zabbix2-server/Makefile (revision 413934) +++ head/net-mgmt/zabbix2-server/Makefile (revision 413935) @@ -1,163 +1,163 @@ # Created by: Jim Riggs # $FreeBSD$ PORTNAME= zabbix2 PORTVERSION= 2.0.16 -PORTREVISION?= 0 +PORTREVISION?= 1 CATEGORIES= net-mgmt MASTER_SITES= SF/zabbix/ZABBIX%20Latest%20Stable/${PORTVERSION} PKGNAMESUFFIX?= -server DISTNAME= zabbix-${PORTVERSION} MAINTAINER= pakhom@pakhom.spb.ru COMMENT= Enterprise-class open source distributed monitoring (${PKGNAMESUFFIX:S/^-//}) LICENSE= GPLv2 CONFLICTS= ${PKGBASE}-1.[0-8]* IGNORE_WITH_MYSQL= 41 .if ${PKGNAMESUFFIX} != "-agent" CONFLICTS+= ${PORTNAME}-1.[0-8]* .endif ZABBIX_BUILD= ${PKGNAMESUFFIX:S/^-//} .if ${ZABBIX_BUILD} != "frontend" # frontend only needs the version/distribution settings .if ${ZABBIX_BUILD} != "agent" USE_RC_SUBR= zabbix_${ZABBIX_BUILD} .else USE_RC_SUBR= zabbix_${ZABBIX_BUILD}d .endif USES= pkgconfig iconv USERS= zabbix GROUPS= zabbix .if ${ZABBIX_BUILD} != "proxy" PLIST_SUB= PROXY="@comment " .else PLIST_SUB= PROXY="" .endif .if ${ZABBIX_BUILD} == "server" PLIST_SUB+= SERVER="" .else PLIST_SUB+= SERVER="@comment " .endif PLIST_SUB+= ZABBIX_BUILD=${ZABBIX_BUILD} PORTVERSION=${PORTVERSION} SUB_LIST= ZABBIX_BUILD=${ZABBIX_BUILD} ZABBIX_REQUIRE=${ZABBIX_REQUIRE} MAKE_ARGS+= ARCH=freebsd GNU_CONFIGURE= yes CONFIGURE_ARGS+= --enable-${ZABBIX_BUILD} \ --sysconfdir=${ETCDIR} \ --datadir=${ETCDIR} .if ${ZABBIX_BUILD} != "agent" LIB_DEPENDS= libnetsnmp.so:net-mgmt/net-snmp USES+= execinfo CPPFLAGS+= ${EXECINFO_CPPFLAGS} LDFLAGS+= ${EXECINFO_LDFLAGS} SUB_FILES= pkg-message CONFIGURE_ARGS+= --with-net-snmp OPTIONS_DEFINE= IPV6 FPING JABBER CURL LDAP IPMI SSH NMAP JAVAGW OPTIONS_DEFAULT= MYSQL IPV6 FPING JABBER CURL UNIXODBC OPTIONS_SUB= yes CURL_DESC= Support for web monitoring FPING_DESC= Build/install fping for ping checks IPMI_DESC= Support for IPMI checks JABBER_DESC= Support for Jabber media type LDAP_DESC= Support for LDAP server checks NMAP_DESC= Build/install nmap for o/s detection SSH_DESC= Support for SSH-based checks JAVAGW_DESC= Support for Java gateway ODBC_DESC= Support for database checks via ODBC OPTIONS_SINGLE= DB ODBC OPTIONS_SINGLE_DB= MYSQL PGSQL SQLITE ORACLE OPTIONS_SINGLE_ODBC= IODBC UNIXODBC MYSQL_CONFIGURE_WITH= mysql MYSQL_USE= MYSQL=yes PGSQL_CONFIGURE_WITH= postgresql PGSQL_USES= pgsql SQLITE_CONFIGURE_WITH= sqlite3 SQLITE_USE= SQLITE=3 ORACLE_CONFIGURE_WITH= oracle CURL_CONFIGURE_WITH= libcurl CURL_LIB_DEPENDS= libcurl.so:ftp/curl LDAP_CONFIGURE_WITH= ldap LDAP_USE= OPENLDAP=yes IPMI_CONFIGURE_WITH= openipmi IPMI_LIB_DEPENDS= libOpenIPMI.so:sysutils/openipmi JABBER_CONFIGURE_WITH= jabber JABBER_LIB_DEPENDS= libiksemel.so:textproc/iksemel FPING_RUN_DEPENDS= fping:net/fping SSH_CONFIGURE_WITH= ssh2 SSH_LIB_DEPENDS= libssh2.so:security/libssh2 IODBC_CONFIGURE_WITH= iodbc IODBC_LIB_DEPENDS= libiodbc.so:databases/libiodbc UNIXODBC_CONFIGURE_WITH= unixodbc UNIXODBC_LIB_DEPENDS= libodbc.so:databases/unixODBC .endif # if ${ZABBIX_BUILD} != "agent" IPV6_CONFIGURE_ENABLE= ipv6 NMAP_RUN_DEPENDS= nmap:security/nmap \ sudo:security/sudo JAVAGW_CONFIGURE_ENABLE= java JAVAGW_USE= JAVA=yes .include post-patch: @${GREP} -rl "/etc/zabbix" ${WRKSRC} \ | ${XARGS} ${REINPLACE_CMD} -e 's#/etc/zabbix#${ETCDIR}#g' @${REINPLACE_CMD} -e 's#/usr/sbin/fping#${LOCALBASE}/sbin/fping#g' ${WRKSRC}/conf/zabbix_*.conf .if ${ZABBIX_BUILD} != "agent" .for d in mysql oracle postgresql sqlite3 @${REINPLACE_CMD} -e 's|/bin/ping|/sbin/ping|g; \ s|/usr/bin/traceroute|/usr/sbin/traceroute|g; \ s|sudo /usr/bin/nmap|sudo ${LOCALBASE}/bin/nmap|g;' \ ${WRKSRC}/database/${d}/data.sql .endfor .endif @${REINPLACE_CMD} -Ee 's|(@sysconfdir@/(\$$\([A-Z]*_CONFIG\)))" ([|][|] cp "../../conf/\$$\([A-Z]*_CONFIG\)" "\$$\(DESTDIR\)@sysconfdir@)"|\1.sample" \3/\2.sample"|;' \ ${WRKSRC}/src/zabbix_${ZABBIX_BUILD}/Makefile.in @${FIND} ${WRKSRC} -type f \( -name '*.bak' -or -name '*.orig' \) -exec ${RM} -f {} + post-install: .if ${PORT_OPTIONS:MJAVAGW} @${MV} ${STAGEDIR}${PREFIX}/sbin/zabbix_java/settings.sh ${STAGEDIR}${PREFIX}/sbin/zabbix_java/settings.sh.sample .endif .if ${ZABBIX_BUILD} != "agent" @${MKDIR} "${STAGEDIR}${DATADIR}/${ZABBIX_BUILD}/database" @cd ${WRKSRC}/upgrades/ && ${COPYTREE_SHARE} dbpatches ${STAGEDIR}${DATADIR}/${ZABBIX_BUILD}/upgrades/ @cd ${WRKSRC}/database/ && ${COPYTREE_SHARE} "ibm_db2 mysql oracle postgresql sqlite3" ${STAGEDIR}${DATADIR}/${ZABBIX_BUILD}/database/ .endif .endif # if ${ZABBIX_BUILD} != "frontend" .include Index: head/net-mgmt/zabbix2-server/files/zabbix_agentd.in =================================================================== --- head/net-mgmt/zabbix2-server/files/zabbix_agentd.in (revision 413934) +++ head/net-mgmt/zabbix2-server/files/zabbix_agentd.in (revision 413935) @@ -1,26 +1,52 @@ #!/bin/sh # PROVIDE: zabbix_agentd # REQUIRE: DAEMON # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf.local or /etc/rc.conf to # enable zabbix_agentd: # # zabbix_agentd_enable (bool): Set to NO by default. Set it to YES to # enable zabbix_agentd. +# zabbix_agentd_paths (string): Set to standard path by default. Set a search +# if you have custom userparams that need binaries elsewhere. +# zabbix_agentd_config (string): Set to the standard config file path by +# default. # . /etc/rc.subr name="zabbix_agentd" rcvar=zabbix_agentd_enable -command="%%PREFIX%%/sbin/${name}" -required_files="%%ETCDIR%%/${name}.conf" - load_rc_config $name : ${zabbix_agentd_enable="NO"} +: ${zabbix_agentd_paths=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin} +: ${zabbix_agentd_config="%%ETCDIR%%/${name}.conf"} + +command="%%PREFIX%%/sbin/${name}" +required_files="${zabbix_agentd_config}" +start_precmd="find_pidfile" +status_precmd="find_pidfile" +stop_precmd="find_pidfile" + +find_pidfile() +{ + if get_pidfile_from_conf PidFile ${zabbix_agentd_config}; then + pidfile="$_pidfile_from_conf" + else + pidfile="/tmp/${name}.pid" + fi + + # This shouldn't be necessary with pidfile, but empirically it was the + # only way to reap the parent PID instead of all PIDs from + # check_process, which may leak SysV IPC objects and prevent restart + # and/or race condition on restart. + rc_pid=$(check_pidfile ${pidfile} ${command}) +} + +export PATH="${zabbix_agentd_paths}" run_rc_command "$1" Index: head/net-mgmt/zabbix2-server/files/zabbix_proxy.in =================================================================== --- head/net-mgmt/zabbix2-server/files/zabbix_proxy.in (revision 413934) +++ head/net-mgmt/zabbix2-server/files/zabbix_proxy.in (revision 413935) @@ -1,26 +1,53 @@ #!/bin/sh # PROVIDE: zabbix_proxy # REQUIRE: DAEMON%%ZABBIX_REQUIRE%% # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf.local or /etc/rc.conf to # enable zabbix_proxy: # # zabbix_proxy_enable (bool): Set to NO by default. Set it to YES to # enable zabbix_proxy. +# zabbix_proxy_paths (string): Set to standard path by default. Set a search +# if you have custom externals that need binaries elsewhere. +# zabbix_proxy_config (string): Set to the standard config file path by +# default. # . /etc/rc.subr name="zabbix_proxy" rcvar=zabbix_proxy_enable -command="%%PREFIX%%/sbin/${name}" -required_files="%%ETCDIR%%/${name}.conf" - load_rc_config $name : ${zabbix_proxy_enable="NO"} +: ${zabbix_proxy_paths=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin} +: ${zabbix_proxy_config="%%ETCDIR%%/${name}.conf"} + +command="%%PREFIX%%/sbin/${name}" +required_files="${zabbix_proxy_config}" +start_precmd="find_pidfile" +status_precmd="find_pidfile" +stop_precmd="find_pidfile" + + +find_pidfile() +{ + if get_pidfile_from_conf PidFile ${zabbix_agentd_config}; then + pidfile="$_pidfile_from_conf" + else + pidfile="/tmp/${name}.pid" + fi + + # This shouldn't be necessary with pidfile, but empirically it was the + # only way to reap the parent PID instead of all PIDs from + # check_process, which may leak SysV IPC objects and prevent restart + # and/or race condition on restart. + rc_pid=$(check_pidfile ${pidfile} ${command}) +} + +export PATH="${zabbix_proxy_paths}" run_rc_command "$1" Index: head/net-mgmt/zabbix2-server/files/zabbix_server.in =================================================================== --- head/net-mgmt/zabbix2-server/files/zabbix_server.in (revision 413934) +++ head/net-mgmt/zabbix2-server/files/zabbix_server.in (revision 413935) @@ -1,26 +1,52 @@ #!/bin/sh # PROVIDE: zabbix_server # REQUIRE: DAEMON%%ZABBIX_REQUIRE%% # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf.local or /etc/rc.conf to # enable zabbix_server: # # zabbix_server_enable (bool): Set to NO by default. Set it to YES to # enable zabbix_server. +# zabbix_server_paths (string): Set to standard path by default. Set a search +# if you have custom externals that need binaries elsewhere. +# zabbix_server_config (string): Set to the standard config file path by +# default. # . /etc/rc.subr name="zabbix_server" rcvar=zabbix_server_enable -command="%%PREFIX%%/sbin/${name}" -required_files="%%ETCDIR%%/${name}.conf" - load_rc_config $name : ${zabbix_server_enable="NO"} +: ${zabbix_server_paths=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin} +: ${zabbix_server_config="%%ETCDIR%%/${name}.conf"} + +command="%%PREFIX%%/sbin/${name}" +required_files="${zabbix_server_config}" +start_precmd="find_pidfile" +status_precmd="find_pidfile" +stop_precmd="find_pidfile" + +find_pidfile() +{ + if get_pidfile_from_conf PidFile ${zabbix_agentd_config}; then + pidfile="$_pidfile_from_conf" + else + pidfile="/tmp/${name}.pid" + fi + + # This shouldn't be necessary with pidfile, but empirically it was the + # only way to reap the parent PID instead of all PIDs from + # check_process, which may leak SysV IPC objects and prevent restart + # and/or race condition on restart. + rc_pid=$(check_pidfile ${pidfile} ${command}) +} + +export PATH="${zabbix_server_paths}" run_rc_command "$1" Index: head/net-mgmt/zabbix22-server/Makefile =================================================================== --- head/net-mgmt/zabbix22-server/Makefile (revision 413934) +++ head/net-mgmt/zabbix22-server/Makefile (revision 413935) @@ -1,170 +1,171 @@ # Created by: Pakhom Golynga # $FreeBSD$ PORTNAME= zabbix22 PORTVERSION= 2.2.11 +PORTREVISION= 1 CATEGORIES= net-mgmt MASTER_SITES= SF/zabbix/ZABBIX%20Latest%20Stable/${PORTVERSION} PKGNAMESUFFIX?= -server DISTNAME= zabbix-${PORTVERSION} MAINTAINER= pakhom@pakhom.spb.ru COMMENT= Enterprise-class open source distributed monitoring (${PKGNAMESUFFIX:S/^-//}) LICENSE= GPLv2 CONFLICTS= ${PKGBASE}-1.[0-8]* IGNORE_WITH_PHP= 52 IGNORE_WITH_MYSQL= 41 .if ${PKGNAMESUFFIX} != "-agent" CONFLICTS+= ${PORTNAME}-1.[0-8]* .endif ZABBIX_BUILD= ${PKGNAMESUFFIX:S/^-//} .if ${ZABBIX_BUILD} != "frontend" # frontend only needs the version/distribution settings .if ${ZABBIX_BUILD} != "agent" USE_RC_SUBR= zabbix_${ZABBIX_BUILD} .else USE_RC_SUBR= zabbix_${ZABBIX_BUILD}d .endif USES= pkgconfig iconv USERS= zabbix GROUPS= zabbix .if ${ZABBIX_BUILD} != "proxy" PLIST_SUB= PROXY="@comment " .else PLIST_SUB= PROXY="" .endif .if ${ZABBIX_BUILD} == "server" PLIST_SUB+= SERVER="" .else PLIST_SUB+= SERVER="@comment " .endif PLIST_SUB+= ZABBIX_BUILD=${ZABBIX_BUILD} PORTVERSION=${PORTVERSION} SUB_LIST= ZABBIX_BUILD=${ZABBIX_BUILD} ZABBIX_REQUIRE=${ZABBIX_REQUIRE} MAKE_ARGS+= ARCH=freebsd GNU_CONFIGURE= yes CONFIGURE_ARGS+= --enable-${ZABBIX_BUILD} \ --sysconfdir=${ETCDIR} \ --datadir=${ETCDIR} \ --with-iconv=${ICONV_PREFIX} .if ${ZABBIX_BUILD} != "agent" LIB_DEPENDS= libnetsnmp.so:net-mgmt/net-snmp USES+= execinfo CPPFLAGS+= ${EXECINFO_CPPFLAGS} LDFLAGS+= ${EXECINFO_LDFLAGS} SUB_FILES= pkg-message CONFIGURE_ARGS+= --with-net-snmp OPTIONS_DEFINE= IPV6 FPING JABBER CURL LDAP IPMI SSH NMAP JAVAGW LIBXML2 OPTIONS_DEFAULT= MYSQL IPV6 FPING JABBER CURL UNIXODBC OPTIONS_SUB= yes CURL_DESC= Support for web monitoring FPING_DESC= Build/install fping for ping checks IPMI_DESC= Support for IPMI checks JABBER_DESC= Support for Jabber media type LDAP_DESC= Support for LDAP server checks NMAP_DESC= Build/install Nmap for OS detection SSH_DESC= Support for SSH-based checks ODBC_DESC= Support for database checks via ODBC JAVAGW_DESC= Support for Java gateway LIBXML2_DESC= Support for libxml2 (required by monitoring VMware) OPTIONS_SINGLE= DB ODBC OPTIONS_SINGLE_DB= MYSQL PGSQL SQLITE ORACLE OPTIONS_SINGLE_ODBC= IODBC UNIXODBC MYSQL_CONFIGURE_WITH= mysql MYSQL_USE= MYSQL=yes PGSQL_CONFIGURE_WITH= postgresql PGSQL_USES= pgsql SQLITE_CONFIGURE_WITH= sqlite3 SQLITE_USE= SQLITE=3 ORACLE_CONFIGURE_WITH= oracle CURL_CONFIGURE_WITH= libcurl CURL_LIB_DEPENDS= libcurl.so:ftp/curl LDAP_CONFIGURE_WITH= ldap LDAP_USE= OPENLDAP=yes IPMI_CONFIGURE_WITH= openipmi IPMI_LIB_DEPENDS= libOpenIPMI.so:sysutils/openipmi JABBER_CONFIGURE_WITH= jabber JABBER_LIB_DEPENDS= libiksemel.so:textproc/iksemel FPING_RUN_DEPENDS= fping:net/fping SSH_CONFIGURE_WITH= ssh2 SSH_LIB_DEPENDS= libssh2.so:security/libssh2 IODBC_CONFIGURE_WITH= iodbc IODBC_LIB_DEPENDS= libiodbc.so:databases/libiodbc UNIXODBC_CONFIGURE_WITH= unixodbc UNIXODBC_LIB_DEPENDS= libodbc.so:databases/unixODBC .endif # if ${ZABBIX_BUILD} != "agent" IPV6_CONFIGURE_ENABLE= ipv6 NMAP_RUN_DEPENDS= nmap:security/nmap \ sudo:security/sudo JAVAGW_CONFIGURE_ENABLE= java JAVAGW_USE= JAVA=yes LIBXML2_CONFIGURE_WITH= libxml2 LIBXML2_LIB_DEPENDS= libxml2.so:textproc/libxml2 .include post-patch: @${GREP} -rl "/etc/zabbix" ${WRKSRC} \ | ${XARGS} ${REINPLACE_CMD} -e 's#/etc/zabbix#${ETCDIR}#g' @${REINPLACE_CMD} -e 's#/usr/sbin/fping#${LOCALBASE}/sbin/fping#g' ${WRKSRC}/conf/zabbix_*.conf .if ${ZABBIX_BUILD} != "agent" .if ! ${PORT_OPTIONS:MFPING} .endif .for d in mysql oracle postgresql sqlite3 @${REINPLACE_CMD} -e 's|/bin/ping|/sbin/ping|g; \ s|/usr/bin/traceroute|/usr/sbin/traceroute|g; \ s|sudo /usr/bin/nmap|sudo ${LOCALBASE}/bin/nmap|g;' \ ${WRKSRC}/database/${d}/data.sql .endfor .endif @${REINPLACE_CMD} -Ee 's|(@sysconfdir@/(\$$\([A-Z]*_CONFIG\)))" ([|][|] cp "../../conf/\$$\([A-Z]*_CONFIG\)" "\$$\(DESTDIR\)@sysconfdir@)"|\1.sample" \3/\2.sample"|;' \ ${WRKSRC}/src/zabbix_${ZABBIX_BUILD}/Makefile.in @${FIND} ${WRKSRC} -type f \( -name '*.bak' -or -name '*.orig' \) -exec ${RM} -f {} + post-install: .if ${PORT_OPTIONS:MJAVAGW} @${MV} ${STAGEDIR}${PREFIX}/sbin/zabbix_java/settings.sh ${STAGEDIR}${PREFIX}/sbin/zabbix_java/settings.sh.sample .endif .if ${ZABBIX_BUILD} != "agent" ${MKDIR} "${STAGEDIR}${DATADIR}/${ZABBIX_BUILD}/database" cd ${WRKSRC}/upgrades/ && ${COPYTREE_SHARE} dbpatches ${STAGEDIR}${DATADIR}/${ZABBIX_BUILD}/upgrades/ cd ${WRKSRC}/database/ && ${COPYTREE_SHARE} "ibm_db2 mysql oracle postgresql sqlite3" ${STAGEDIR}${DATADIR}/${ZABBIX_BUILD}/database/ .endif .endif .include Index: head/net-mgmt/zabbix22-server/files/zabbix_agentd.in =================================================================== --- head/net-mgmt/zabbix22-server/files/zabbix_agentd.in (revision 413934) +++ head/net-mgmt/zabbix22-server/files/zabbix_agentd.in (revision 413935) @@ -1,26 +1,52 @@ #!/bin/sh # PROVIDE: zabbix_agentd # REQUIRE: DAEMON # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf.local or /etc/rc.conf to # enable zabbix_agentd: # # zabbix_agentd_enable (bool): Set to NO by default. Set it to YES to # enable zabbix_agentd. +# zabbix_agentd_paths (string): Set to standard path by default. Set a search +# if you have custom userparams that need binaries elsewhere. +# zabbix_agentd_config (string): Set to the standard config file path by +# default. # . /etc/rc.subr name="zabbix_agentd" rcvar=zabbix_agentd_enable -command="%%PREFIX%%/sbin/${name}" -required_files="%%ETCDIR%%/${name}.conf" - load_rc_config $name : ${zabbix_agentd_enable="NO"} +: ${zabbix_agentd_paths=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin} +: ${zabbix_agentd_config="%%ETCDIR%%/${name}.conf"} + +command="%%PREFIX%%/sbin/${name}" +required_files="${zabbix_agentd_config}" +start_precmd="find_pidfile" +status_precmd="find_pidfile" +stop_precmd="find_pidfile" + +find_pidfile() +{ + if get_pidfile_from_conf PidFile ${zabbix_agentd_config}; then + pidfile="$_pidfile_from_conf" + else + pidfile="/tmp/${name}.pid" + fi + + # This shouldn't be necessary with pidfile, but empirically it was the + # only way to reap the parent PID instead of all PIDs from + # check_process, which may leak SysV IPC objects and prevent restart + # and/or race condition on restart. + rc_pid=$(check_pidfile ${pidfile} ${command}) +} + +export PATH="${zabbix_agentd_paths}" run_rc_command "$1" Index: head/net-mgmt/zabbix22-server/files/zabbix_proxy.in =================================================================== --- head/net-mgmt/zabbix22-server/files/zabbix_proxy.in (revision 413934) +++ head/net-mgmt/zabbix22-server/files/zabbix_proxy.in (revision 413935) @@ -1,28 +1,54 @@ #!/bin/sh # PROVIDE: zabbix_proxy # 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 # enable zabbix_proxy: # # zabbix_proxy_enable (bool): Set to NO by default. Set it to YES to # enable zabbix_proxy. +# zabbix_proxy_paths (string): Set to standard path by default. Set a search +# if you have custom externals that need binaries elsewhere. +# zabbix_proxy_config (string): Set to the standard config file path by +# default. # . /etc/rc.subr name="zabbix_proxy" rcvar=zabbix_proxy_enable -command="%%PREFIX%%/sbin/${name}" -required_files="%%ETCDIR%%/${name}.conf" - load_rc_config $name : ${zabbix_proxy_enable="NO"} +: ${zabbix_proxy_paths=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin} +: ${zabbix_proxy_config="%%ETCDIR%%/${name}.conf"} + +command="%%PREFIX%%/sbin/${name}" +required_files="${zabbix_proxy_config}" +start_precmd="find_pidfile" +status_precmd="find_pidfile" +stop_precmd="find_pidfile" + +find_pidfile() +{ + if get_pidfile_from_conf PidFile ${zabbix_agentd_config}; then + pidfile="$_pidfile_from_conf" + else + pidfile="/tmp/${name}.pid" + fi + + # This shouldn't be necessary with pidfile, but empirically it was the + # only way to reap the parent PID instead of all PIDs from + # check_process, which may leak SysV IPC objects and prevent restart + # and/or race condition on restart. + rc_pid=$(check_pidfile ${pidfile} ${command}) +} + +export PATH="${zabbix_proxy_paths}" run_rc_command "$1" Index: head/net-mgmt/zabbix22-server/files/zabbix_server.in =================================================================== --- head/net-mgmt/zabbix22-server/files/zabbix_server.in (revision 413934) +++ head/net-mgmt/zabbix22-server/files/zabbix_server.in (revision 413935) @@ -1,28 +1,54 @@ #!/bin/sh # PROVIDE: zabbix_server # 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 # enable zabbix_server: # # zabbix_server_enable (bool): Set to NO by default. Set it to YES to # enable zabbix_server. +# zabbix_server_paths (string): Set to standard path by default. Set a search +# if you have custom externals that need binaries elsewhere. +# zabbix_server_config (string): Set to the standard config file path by +# default. # . /etc/rc.subr name="zabbix_server" rcvar=zabbix_server_enable -command="%%PREFIX%%/sbin/${name}" -required_files="%%ETCDIR%%/${name}.conf" - load_rc_config $name : ${zabbix_server_enable="NO"} +: ${zabbix_server_paths=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin} +: ${zabbix_server_config="%%ETCDIR%%/${name}.conf"} + +command="%%PREFIX%%/sbin/${name}" +required_files="${zabbix_server_config}" +start_precmd="find_pidfile" +status_precmd="find_pidfile" +stop_precmd="find_pidfile" + +find_pidfile() +{ + if get_pidfile_from_conf PidFile ${zabbix_agentd_config}; then + pidfile="$_pidfile_from_conf" + else + pidfile="/tmp/${name}.pid" + fi + + # This shouldn't be necessary with pidfile, but empirically it was the + # only way to reap the parent PID instead of all PIDs from + # check_process, which may leak SysV IPC objects and prevent restart + # and/or race condition on restart. + rc_pid=$(check_pidfile ${pidfile} ${command}) +} + +export PATH="${zabbix_server_paths}" run_rc_command "$1" Index: head/net-mgmt/zabbix24-server/Makefile =================================================================== --- head/net-mgmt/zabbix24-server/Makefile (revision 413934) +++ head/net-mgmt/zabbix24-server/Makefile (revision 413935) @@ -1,179 +1,179 @@ # Created by: Pakhom Golynga # $FreeBSD$ PORTNAME= zabbix24 PORTVERSION= 2.4.7 -PORTREVISION?= 0 +PORTREVISION?= 1 CATEGORIES= net-mgmt MASTER_SITES= SF/zabbix/ZABBIX%20Latest%20Stable/${PORTVERSION} PKGNAMESUFFIX?= -server DISTNAME= zabbix-${PORTVERSION} MAINTAINER= pakhom@pakhom.spb.ru COMMENT= Enterprise-class open source distributed monitoring (${PKGNAMESUFFIX:S/^-//}) LICENSE= GPLv2 CONFLICTS= ${PKGBASE}-1.[0-8]* IGNORE_WITH_PHP= 52 IGNORE_WITH_MYSQL= 41 .if ${PKGNAMESUFFIX} != "-agent" CONFLICTS+= ${PORTNAME}-1.[0-8]* .endif ZABBIX_BUILD= ${PKGNAMESUFFIX:S/^-//} .if ${ZABBIX_BUILD} != "frontend" # frontend only needs the version/distribution settings .if ${ZABBIX_BUILD} != "agent" USE_RC_SUBR= zabbix_${ZABBIX_BUILD} .else USE_RC_SUBR= zabbix_${ZABBIX_BUILD}d .endif USES= pkgconfig iconv USERS= zabbix GROUPS= zabbix .if ${ZABBIX_BUILD} != "proxy" PLIST_SUB= PROXY="@comment " .else PLIST_SUB= PROXY="" .endif .if ${ZABBIX_BUILD} == "server" PLIST_SUB+= SERVER="" .else PLIST_SUB+= SERVER="@comment " .endif PLIST_SUB+= ZABBIX_BUILD=${ZABBIX_BUILD} PORTVERSION=${PORTVERSION} SUB_LIST= ZABBIX_BUILD=${ZABBIX_BUILD} ZABBIX_REQUIRE=${ZABBIX_REQUIRE} MAKE_ARGS+= ARCH=freebsd GNU_CONFIGURE= yes CONFIGURE_ARGS+= --enable-${ZABBIX_BUILD} \ --sysconfdir=${ETCDIR} \ --datadir=${ETCDIR} \ --with-iconv=${ICONV_PREFIX} .if ${ZABBIX_BUILD} != "agent" LIB_DEPENDS= libnetsnmp.so:net-mgmt/net-snmp USES+= execinfo CPPFLAGS+= ${EXECINFO_CPPFLAGS} LDFLAGS+= ${EXECINFO_LDFLAGS} SUB_FILES= pkg-message CONFIGURE_ARGS+= --with-net-snmp OPTIONS_DEFINE= IPV6 FPING JABBER CURL LDAP IPMI SSH NMAP JAVAGW \ LIBXML2 OPTIONS_DEFAULT= IPV6 FPING JABBER CURL UNIXODBC MYSQL SSH OPTIONS_SUB= yes CURL_DESC= Support for web monitoring FPING_DESC= Build/install fping for ping checks IPMI_DESC= Support for IPMI checks JABBER_DESC= Support for Jabber media type LDAP_DESC= Support for LDAP server checks NMAP_DESC= Build/install nmap for o/s detection SSH_DESC= Support for SSH-based checks ODBC_DESC= Support for database checks via ODBC JAVAGW_DESC= Support for Java gateway LIBXML2_DESC= Support for libxml2 (required by monitoring VMware) OPTIONS_SINGLE= DB ODBC OPTIONS_SINGLE_DB= MYSQL PGSQL SQLITE ORACLE OPTIONS_SINGLE_ODBC= IODBC UNIXODBC MYSQL_CONFIGURE_WITH= mysql MYSQL_USE= MYSQL=yes PGSQL_CONFIGURE_WITH= postgresql PGSQL_USES= pgsql SQLITE_CONFIGURE_WITH= sqlite3 SQLITE_USE= SQLITE=3 ORACLE_CONFIGURE_WITH= oracle CURL_CONFIGURE_WITH= libcurl CURL_LIB_DEPENDS= libcurl.so:ftp/curl LDAP_CONFIGURE_WITH= ldap LDAP_USE= OPENLDAP=yes IPMI_CONFIGURE_WITH= openipmi IPMI_LIB_DEPENDS= libOpenIPMI.so:sysutils/openipmi JABBER_CONFIGURE_WITH= jabber JABBER_LIB_DEPENDS= libiksemel.so:textproc/iksemel FPING_RUN_DEPENDS= fping:net/fping SSH_CONFIGURE_WITH= ssh2 SSH_LIB_DEPENDS= libssh2.so:security/libssh2 IODBC_CONFIGURE_WITH= iodbc IODBC_LIB_DEPENDS= libiodbc.so:databases/libiodbc UNIXODBC_CONFIGURE_WITH=unixodbc UNIXODBC_LIB_DEPENDS= libodbc.so:databases/unixODBC .endif # if ${ZABBIX_BUILD} != "agent" IPV6_CONFIGURE_ENABLE= ipv6 NMAP_RUN_DEPENDS= nmap:security/nmap \ sudo:security/sudo JAVAGW_CONFIGURE_ENABLE=java JAVAGW_USE= JAVA=yes LIBXML2_CONFIGURE_WITH= libxml2 LIBXML2_LIB_DEPENDS= libxml2.so:textproc/libxml2 .include post-patch: @${GREP} -rl "/etc/zabbix" ${WRKSRC} \ | ${XARGS} ${REINPLACE_CMD} -e 's#/etc/zabbix#${ETCDIR}#g' @${REINPLACE_CMD} -e 's#/usr/sbin/fping#${LOCALBASE}/sbin/fping#g' \ ${WRKSRC}/conf/zabbix_*.conf .if ${ZABBIX_BUILD} != "agent" . for d in mysql oracle postgresql sqlite3 @${REINPLACE_CMD} \ -e 's|/bin/ping|/sbin/ping|g' \ -e 's|/usr/bin/traceroute|/usr/sbin/traceroute|g' \ -e 's|sudo /usr/bin/nmap|sudo ${LOCALBASE}/bin/nmap|g' \ ${WRKSRC}/database/${d}/data.sql . endfor .endif @${REINPLACE_CMD} \ -Ee 's|(@sysconfdir@/(\$$\([A-Z]*_CONFIG\)))" ([|][|] cp "../../conf/\$$\([A-Z]*_CONFIG\)" "\$$\(DESTDIR\)@sysconfdir@)"|\1.sample" \3/\2.sample"|;' \ ${WRKSRC}/src/zabbix_${ZABBIX_BUILD}/Makefile.in @${FIND} ${WRKSRC} -type f \( -name '*.bak' -or -name '*.orig' \) \ -exec ${RM} -f {} + post-install: .if ${PORT_OPTIONS:MJAVAGW} ${MV} ${STAGEDIR}${PREFIX}/sbin/zabbix_java/settings.sh \ ${STAGEDIR}${PREFIX}/sbin/zabbix_java/settings.sh.sample .endif .if ${ZABBIX_BUILD} != "agent" ${MKDIR} ${STAGEDIR}${DATADIR}/${ZABBIX_BUILD:Q}/database (cd ${WRKSRC}/upgrades/ && ${COPYTREE_SHARE} dbpatches \ ${STAGEDIR}${DATADIR}/${ZABBIX_BUILD:Q}/upgrades/) (cd ${WRKSRC}/database/ && \ ${COPYTREE_SHARE} "ibm_db2 mysql oracle postgresql sqlite3" \ ${STAGEDIR}${DATADIR}/${ZABBIX_BUILD:Q}/database/) .endif .endif .include Index: head/net-mgmt/zabbix24-server/files/zabbix_agentd.in =================================================================== --- head/net-mgmt/zabbix24-server/files/zabbix_agentd.in (revision 413934) +++ head/net-mgmt/zabbix24-server/files/zabbix_agentd.in (revision 413935) @@ -1,26 +1,52 @@ #!/bin/sh # PROVIDE: zabbix_agentd # REQUIRE: DAEMON # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf.local or /etc/rc.conf to # enable zabbix_agentd: # # zabbix_agentd_enable (bool): Set to NO by default. Set it to YES to # enable zabbix_agentd. +# zabbix_agentd_paths (string): Set to standard path by default. Set a search +# if you have custom userparams that need binaries elsewhere. +# zabbix_agentd_config (string): Set to the standard config file path by +# default. # . /etc/rc.subr name="zabbix_agentd" rcvar=zabbix_agentd_enable -command="%%PREFIX%%/sbin/${name}" -required_files="%%ETCDIR%%/${name}.conf" - load_rc_config $name : ${zabbix_agentd_enable="NO"} +: ${zabbix_agentd_paths=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin} +: ${zabbix_agentd_config="%%ETCDIR%%/${name}.conf"} + +command="%%PREFIX%%/sbin/${name}" +required_files="${zabbix_agentd_config}" +start_precmd="find_pidfile" +status_precmd="find_pidfile" +stop_precmd="find_pidfile" + +find_pidfile() +{ + if get_pidfile_from_conf PidFile ${zabbix_agentd_config}; then + pidfile="$_pidfile_from_conf" + else + pidfile="/tmp/${name}.pid" + fi + + # This shouldn't be necessary with pidfile, but empirically it was the + # only way to reap the parent PID instead of all PIDs from + # check_process, which may leak SysV IPC objects and prevent restart + # and/or race condition on restart. + rc_pid=$(check_pidfile ${pidfile} ${command}) +} + +export PATH="${zabbix_agentd_paths}" run_rc_command "$1" Index: head/net-mgmt/zabbix24-server/files/zabbix_proxy.in =================================================================== --- head/net-mgmt/zabbix24-server/files/zabbix_proxy.in (revision 413934) +++ head/net-mgmt/zabbix24-server/files/zabbix_proxy.in (revision 413935) @@ -1,28 +1,54 @@ #!/bin/sh # PROVIDE: zabbix_proxy # 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 # enable zabbix_proxy: # # zabbix_proxy_enable (bool): Set to NO by default. Set it to YES to # enable zabbix_proxy. +# zabbix_proxy_paths (string): Set to standard path by default. Set a search +# if you have custom externals that need binaries elsewhere. +# zabbix_proxy_config (string): Set to the standard config file path by +# default. # . /etc/rc.subr name="zabbix_proxy" rcvar=zabbix_proxy_enable -command="%%PREFIX%%/sbin/${name}" -required_files="%%ETCDIR%%/${name}.conf" - load_rc_config $name : ${zabbix_proxy_enable="NO"} +: ${zabbix_proxy_paths=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin} +: ${zabbix_proxy_config="%%ETCDIR%%/${name}.conf"} + +command="%%PREFIX%%/sbin/${name}" +required_files="${zabbix_proxy_config}" +start_precmd="find_pidfile" +status_precmd="find_pidfile" +stop_precmd="find_pidfile" + +find_pidfile() +{ + if get_pidfile_from_conf PidFile ${zabbix_agentd_config}; then + pidfile="$_pidfile_from_conf" + else + pidfile="/tmp/${name}.pid" + fi + + # This shouldn't be necessary with pidfile, but empirically it was the + # only way to reap the parent PID instead of all PIDs from + # check_process, which may leak SysV IPC objects and prevent restart + # and/or race condition on restart. + rc_pid=$(check_pidfile ${pidfile} ${command}) +} + +export PATH="${zabbix_proxy_paths}" run_rc_command "$1" Index: head/net-mgmt/zabbix24-server/files/zabbix_server.in =================================================================== --- head/net-mgmt/zabbix24-server/files/zabbix_server.in (revision 413934) +++ head/net-mgmt/zabbix24-server/files/zabbix_server.in (revision 413935) @@ -1,28 +1,54 @@ #!/bin/sh # PROVIDE: zabbix_server # 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 # enable zabbix_server: # # zabbix_server_enable (bool): Set to NO by default. Set it to YES to # enable zabbix_server. +# zabbix_server_paths (string): Set to standard path by default. Set a search +# if you have custom externals that need binaries elsewhere. +# zabbix_server_config (string): Set to the standard config file path by +# default. # . /etc/rc.subr name="zabbix_server" rcvar=zabbix_server_enable -command="%%PREFIX%%/sbin/${name}" -required_files="%%ETCDIR%%/${name}.conf" - load_rc_config $name : ${zabbix_server_enable="NO"} +: ${zabbix_server_paths=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin} +: ${zabbix_server_config="%%ETCDIR%%/${name}.conf"} + +command="%%PREFIX%%/sbin/${name}" +required_files="${zabbix_server_config}" +start_precmd="find_pidfile" +status_precmd="find_pidfile" +stop_precmd="find_pidfile" + +find_pidfile() +{ + if get_pidfile_from_conf PidFile ${zabbix_agentd_config}; then + pidfile="$_pidfile_from_conf" + else + pidfile="/tmp/${name}.pid" + fi + + # This shouldn't be necessary with pidfile, but empirically it was the + # only way to reap the parent PID instead of all PIDs from + # check_process, which may leak SysV IPC objects and prevent restart + # and/or race condition on restart. + rc_pid=$(check_pidfile ${pidfile} ${command}) +} + +export PATH="${zabbix_server_paths}" run_rc_command "$1" Index: head/net-mgmt/zabbix3-server/Makefile =================================================================== --- head/net-mgmt/zabbix3-server/Makefile (revision 413934) +++ head/net-mgmt/zabbix3-server/Makefile (revision 413935) @@ -1,197 +1,197 @@ # Created by: Pakhom Golynga # $FreeBSD$ PORTNAME= zabbix3 PORTVERSION= 3.0.1 -PORTREVISION?= 1 +PORTREVISION?= 2 CATEGORIES= net-mgmt MASTER_SITES= SF/zabbix/ZABBIX%20Latest%20Stable/${PORTVERSION} PKGNAMESUFFIX?= -server DISTNAME= zabbix-${PORTVERSION} MAINTAINER= pakhom@pakhom.spb.ru COMMENT= Enterprise-class open source distributed monitoring (${PKGNAMESUFFIX:S/^-//}) LTS LICENSE= GPLv2 CONFLICTS= ${PKGBASE}-1.[0-8]* IGNORE_WITH_PHP= 52 IGNORE_WITH_MYSQL= 41 .if ${PKGNAMESUFFIX} != "-agent" CONFLICTS+= ${PORTNAME}-1.[0-8]* .endif ZABBIX_BUILD= ${PKGNAMESUFFIX:S/^-//} .if ${ZABBIX_BUILD} != "frontend" # frontend only needs the version/distribution settings .if ${ZABBIX_BUILD} != "agent" USE_RC_SUBR= zabbix_${ZABBIX_BUILD} .else USE_RC_SUBR= zabbix_${ZABBIX_BUILD}d .endif USES= pkgconfig iconv USERS= zabbix GROUPS= zabbix .if ${ZABBIX_BUILD} != "proxy" PLIST_SUB= PROXY="@comment " .else PLIST_SUB= PROXY="" .endif .if ${ZABBIX_BUILD} == "server" PLIST_SUB+= SERVER="" .else PLIST_SUB+= SERVER="@comment " .endif PLIST_SUB+= ZABBIX_BUILD=${ZABBIX_BUILD} PORTVERSION=${PORTVERSION} SUB_LIST= ZABBIX_BUILD=${ZABBIX_BUILD} ZABBIX_REQUIRE=${ZABBIX_REQUIRE} MAKE_ARGS+= ARCH=freebsd GNU_CONFIGURE= yes CONFIGURE_ARGS+= --enable-${ZABBIX_BUILD} \ --sysconfdir=${ETCDIR} \ --datadir=${ETCDIR} \ --with-iconv=${ICONV_PREFIX} .if ${ZABBIX_BUILD} != "agent" LIB_DEPENDS= libnetsnmp.so:net-mgmt/net-snmp USES+= execinfo CPPFLAGS+= ${EXECINFO_CPPFLAGS} LDFLAGS+= ${EXECINFO_LDFLAGS} SUB_FILES= pkg-message CONFIGURE_ARGS+= --with-net-snmp OPTIONS_DEFINE= IPV6 FPING JABBER CURL LDAP IPMI SSH NMAP JAVAGW \ LIBXML2 OPTIONS_DEFAULT= IPV6 FPING JABBER CURL UNIXODBC MYSQL SSH OPENSSL OPTIONS_SUB= yes CURL_DESC= Support for web monitoring FPING_DESC= Build/install fping for ping checks IPMI_DESC= Support for IPMI checks JABBER_DESC= Support for Jabber media type LDAP_DESC= Support for LDAP server checks NMAP_DESC= Build/install nmap for o/s detection SSH_DESC= Support for SSH-based checks ODBC_DESC= Support for database checks via ODBC JAVAGW_DESC= Support for Java gateway LIBXML2_DESC= Support for libxml2 (required by monitoring VMware) OPTIONS_SINGLE= DB ODBC SSL OPTIONS_SINGLE_DB= MYSQL PGSQL SQLITE ORACLE OPTIONS_SINGLE_ODBC= IODBC UNIXODBC OPTIONS_SINGLE_SSL= OPENSSL GNUTLS POLARSSL MYSQL_CONFIGURE_WITH= mysql MYSQL_USE= MYSQL=yes PGSQL_CONFIGURE_WITH= postgresql PGSQL_USES= pgsql SQLITE_CONFIGURE_WITH= sqlite3 SQLITE_USE= SQLITE=3 ORACLE_CONFIGURE_WITH= oracle CURL_CONFIGURE_WITH= libcurl CURL_LIB_DEPENDS= libcurl.so:ftp/curl LDAP_CONFIGURE_WITH= ldap LDAP_USE= OPENLDAP=yes IPMI_CONFIGURE_WITH= openipmi IPMI_LIB_DEPENDS= libOpenIPMI.so:sysutils/openipmi JABBER_CONFIGURE_WITH= jabber JABBER_LIB_DEPENDS= libiksemel.so:textproc/iksemel FPING_RUN_DEPENDS= fping:net/fping SSH_CONFIGURE_WITH= ssh2 SSH_LIB_DEPENDS= libssh2.so:security/libssh2 IODBC_CONFIGURE_WITH= iodbc IODBC_LIB_DEPENDS= libiodbc.so:databases/libiodbc UNIXODBC_CONFIGURE_WITH=unixodbc UNIXODBC_LIB_DEPENDS= libodbc.so:databases/unixODBC .else OPTIONS_SINGLE= SSL OPTIONS_SINGLE_SSL= OPENSSL GNUTLS POLARSSL .endif # if ${ZABBIX_BUILD} != "agent" IPV6_CONFIGURE_ENABLE= ipv6 NMAP_RUN_DEPENDS= nmap:security/nmap \ sudo:security/sudo JAVAGW_CONFIGURE_ENABLE=java JAVAGW_USE= JAVA=yes LIBXML2_CONFIGURE_WITH= libxml2 LIBXML2_LIB_DEPENDS= libxml2.so:textproc/libxml2 OPENSSL_CONFIGURE_WITH= openssl OPENSSL_USE= OPENSSL=yes GNUTLS_CONFIGURE_WITH= gnutls GNUTLS_LIB_DEPENDS= libgnutls.so:security/gnutls POLARSSL_CONFIGURE_WITH=mbedtls POLARSSL_LIB_DEPENDS= libmbedtls.so:security/polarssl13 .include .if ${OPSYS} == FreeBSD && ${OSVERSION} < 1000000 && !defined(WITH_OPENSSL_PORT) IGNORE= OpenSSL from the base system is too old, add WITH_OPENSSL_PORT to your /etc/make.conf and rebuild everything that needs SSL. .endif post-patch: @${GREP} -rl "/etc/zabbix" ${WRKSRC} \ | ${XARGS} ${REINPLACE_CMD} -e 's#/etc/zabbix#${ETCDIR}#g' @${REINPLACE_CMD} -e 's#/usr/sbin/fping#${LOCALBASE}/sbin/fping#g' \ ${WRKSRC}/conf/zabbix_*.conf .if ${ZABBIX_BUILD} != "agent" . for d in mysql oracle postgresql sqlite3 @${REINPLACE_CMD} \ -e 's|/bin/ping|/sbin/ping|g' \ -e 's|/usr/bin/traceroute|/usr/sbin/traceroute|g' \ -e 's|sudo /usr/bin/nmap|sudo ${LOCALBASE}/bin/nmap|g' \ ${WRKSRC}/database/${d}/data.sql . endfor .endif @${REINPLACE_CMD} \ -Ee 's|(@sysconfdir@/(\$$\([A-Z]*_CONFIG\)))" ([|][|] cp "../../conf/\$$\([A-Z]*_CONFIG\)" "\$$\(DESTDIR\)@sysconfdir@)"|\1.sample" \3/\2.sample"|;' \ ${WRKSRC}/src/zabbix_${ZABBIX_BUILD}/Makefile.in @${FIND} ${WRKSRC} -type f \( -name '*.bak' -or -name '*.orig' \) \ -exec ${RM} -f {} + post-install: .if ${PORT_OPTIONS:MJAVAGW} ${MV} ${STAGEDIR}${PREFIX}/sbin/zabbix_java/settings.sh \ ${STAGEDIR}${PREFIX}/sbin/zabbix_java/settings.sh.sample .endif .if ${ZABBIX_BUILD} != "agent" ${MKDIR} ${STAGEDIR}${DATADIR}/${ZABBIX_BUILD:Q}/database (cd ${WRKSRC}/upgrades/ && ${COPYTREE_SHARE} dbpatches \ ${STAGEDIR}${DATADIR}/${ZABBIX_BUILD:Q}/upgrades/) (cd ${WRKSRC}/database/ && \ ${COPYTREE_SHARE} "ibm_db2 mysql oracle postgresql sqlite3" \ ${STAGEDIR}${DATADIR}/${ZABBIX_BUILD:Q}/database/) .endif .endif .include Index: head/net-mgmt/zabbix3-server/files/zabbix_agentd.in =================================================================== --- head/net-mgmt/zabbix3-server/files/zabbix_agentd.in (revision 413934) +++ head/net-mgmt/zabbix3-server/files/zabbix_agentd.in (revision 413935) @@ -1,26 +1,55 @@ #!/bin/sh # PROVIDE: zabbix_agentd # REQUIRE: DAEMON # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf.local or /etc/rc.conf to # enable zabbix_agentd: # # zabbix_agentd_enable (bool): Set to NO by default. Set it to YES to # enable zabbix_agentd. +# zabbix_agentd_paths (string): Set to standard path by default. Set a search +# if you have custom userparams that need binaries elsewhere. +# zabbix_agentd_config (string): Set to the standard config file path by +# default. # . /etc/rc.subr name="zabbix_agentd" rcvar=zabbix_agentd_enable command="%%PREFIX%%/sbin/${name}" required_files="%%ETCDIR%%/${name}.conf" load_rc_config $name : ${zabbix_agentd_enable="NO"} +: ${zabbix_agentd_paths=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin} +: ${zabbix_agentd_config="%%ETCDIR%%/${name}.conf"} + +command="%%PREFIX%%/sbin/${name}" +required_files="${zabbix_agentd_config}" +start_precmd="find_pidfile" +status_precmd="find_pidfile" +stop_precmd="find_pidfile" + +find_pidfile() +{ + if get_pidfile_from_conf PidFile ${zabbix_agentd_config}; then + pidfile="$_pidfile_from_conf" + else + pidfile="/tmp/${name}.pid" + fi + + # This shouldn't be necessary with pidfile, but empirically it was the + # only way to reap the parent PID instead of all PIDs from + # check_process, which may leak SysV IPC objects and prevent restart + # and/or race condition on restart. + rc_pid=$(check_pidfile ${pidfile} ${command}) +} + +export PATH="${zabbix_agentd_paths}" run_rc_command "$1" Index: head/net-mgmt/zabbix3-server/files/zabbix_proxy.in =================================================================== --- head/net-mgmt/zabbix3-server/files/zabbix_proxy.in (revision 413934) +++ head/net-mgmt/zabbix3-server/files/zabbix_proxy.in (revision 413935) @@ -1,28 +1,55 @@ #!/bin/sh # PROVIDE: zabbix_proxy # 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 # enable zabbix_proxy: # # zabbix_proxy_enable (bool): Set to NO by default. Set it to YES to # enable zabbix_proxy. +# zabbix_proxy_paths (string): Set to standard path by default. Set a search +# if you have custom externals that need binaries elsewhere. +# zabbix_proxy_config (string): Set to the standard config file path by +# default. # . /etc/rc.subr name="zabbix_proxy" rcvar=zabbix_proxy_enable -command="%%PREFIX%%/sbin/${name}" -required_files="%%ETCDIR%%/${name}.conf" - load_rc_config $name : ${zabbix_proxy_enable="NO"} +: ${zabbix_proxy_paths=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin} +: ${zabbix_proxy_config="%%ETCDIR%%/${name}.conf"} + +command="%%PREFIX%%/sbin/${name}" +required_files="${zabbix_proxy_config}" +start_precmd="find_pidfile" +status_precmd="find_pidfile" +stop_precmd="find_pidfile" + + +find_pidfile() +{ + if get_pidfile_from_conf PidFile ${zabbix_agentd_config}; then + pidfile="$_pidfile_from_conf" + else + pidfile="/tmp/${name}.pid" + fi + + # This shouldn't be necessary with pidfile, but empirically it was the + # only way to reap the parent PID instead of all PIDs from + # check_process, which may leak SysV IPC objects and prevent restart + # and/or race condition on restart. + rc_pid=$(check_pidfile ${pidfile} ${command}) +} + +export PATH="${zabbix_proxy_paths}" run_rc_command "$1" Index: head/net-mgmt/zabbix3-server/files/zabbix_server.in =================================================================== --- head/net-mgmt/zabbix3-server/files/zabbix_server.in (revision 413934) +++ head/net-mgmt/zabbix3-server/files/zabbix_server.in (revision 413935) @@ -1,28 +1,54 @@ #!/bin/sh # PROVIDE: zabbix_server # 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 # enable zabbix_server: # # zabbix_server_enable (bool): Set to NO by default. Set it to YES to # enable zabbix_server. +# zabbix_server_paths (string): Set to standard path by default. Set a search +# if you have custom externals that need binaries elsewhere. +# zabbix_server_config (string): Set to the standard config file path by +# default. # . /etc/rc.subr name="zabbix_server" rcvar=zabbix_server_enable -command="%%PREFIX%%/sbin/${name}" -required_files="%%ETCDIR%%/${name}.conf" - load_rc_config $name : ${zabbix_server_enable="NO"} +: ${zabbix_server_paths=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin} +: ${zabbix_server_config="%%ETCDIR%%/${name}.conf"} + +command="%%PREFIX%%/sbin/${name}" +required_files="${zabbix_server_config}" +start_precmd="find_pidfile" +status_precmd="find_pidfile" +stop_precmd="find_pidfile" + +find_pidfile() +{ + if get_pidfile_from_conf PidFile ${zabbix_agentd_config}; then + pidfile="$_pidfile_from_conf" + else + pidfile="/tmp/${name}.pid" + fi + + # This shouldn't be necessary with pidfile, but empirically it was the + # only way to reap the parent PID instead of all PIDs from + # check_process, which may leak SysV IPC objects and prevent restart + # and/or race condition on restart. + rc_pid=$(check_pidfile ${pidfile} ${command}) +} + +export PATH="${zabbix_server_paths}" run_rc_command "$1"