Index: head/net-mgmt/icinga2/Makefile =================================================================== --- head/net-mgmt/icinga2/Makefile (revision 396646) +++ head/net-mgmt/icinga2/Makefile (revision 396647) @@ -1,100 +1,100 @@ # $FreeBSD$ PORTNAME= icinga2 DISTVERSIONPREFIX= v -DISTVERSION= 2.3.9 +DISTVERSION= 2.3.10 CATEGORIES= net-mgmt MAINTAINER= lme@FreeBSD.org COMMENT= Monitoring and management system for hosts, services and networks LICENSE= GPLv2 LIB_DEPENDS= libboost_system.so:${PORTSDIR}/devel/boost-libs \ libyajl.so:${PORTSDIR}/devel/yajl \ libexecinfo.so:${PORTSDIR}/devel/libexecinfo # for better debugging RUN_DEPENDS= ${LOCALBASE}/bin/bash:${PORTSDIR}/shells/bash USE_GITHUB= yes GH_ACCOUNT= icinga USES= alias bison cmake USE_LDCONFIG= yes USE_RC_SUBR= ${PORTNAME} OPTIONS_DEFINE= DOCS OPTIONS_GROUP= BACKEND OPTIONS_GROUP_BACKEND= MYSQL PGSQL OPTIONS_RADIO= PLUGINS OPTIONS_RADIO_PLUGINS= MONPLUGINS NAGPLUGINS OPTIONS_DEFAULT= MYSQL PGSQL MONPLUGINS MONPLUGINS_RUN_DEPENDS= ${LOCALBASE}/libexec/nagios/check_nagios:${PORTSDIR}/net-mgmt/monitoring-plugins NAGPLUGINS_RUN_DEPENDS= ${LOCALBASE}/libexec/nagios/check_nagios:${PORTSDIR}/net-mgmt/nagios-plugins MYSQL_CMAKE_ON= -DICINGA2_WITH_MYSQL:BOOL=true PGSQL_CMAKE_ON= -DICINGA2_WITH_PGSQL:BOOL=true ICINGA2USER?= icinga ICINGA2GROUP?= icinga USERS= ${ICINGA2USER} GROUPS= ${ICINGA2GROUP} LOCALSTATEDIR?= /var ICINGA2LOGDIR?= /var/log/${PORTNAME} CMAKE_ARGS+= -DICINGA2_USER=${ICINGA2USER} \ -DICINGA2_GROUP=${ICINGA2GROUP} \ -DICINGA2_COMMAND_USER=${ICINGA2USER} \ -DICINGA2_COMMAND_GROUP=${ICINGA2USER} \ -DICINGA2_PLUGINDIR=${LOCALBASE}/libexec/nagios \ -DICINGA2_RUNDIR=/var/run \ -DCMAKE_INSTALL_SYSCONFDIR=${PREFIX}/etc \ -DCMAKE_INSTALL_LOCALSTATEDIR=${LOCALSTATEDIR} \ -DCMAKE_INSTALL_MANDIR=${MANPREFIX}/man \ SUB_LIST= ICINGA2LOGDIR=${ICINGA2LOGDIR} \ ICINGA2USER=${ICINGA2USER} \ ICINGA2GROUP=${ICINGA2GROUP} \ WWWGRP=${WWWGRP} PLIST_SUB= ICINGA2USER=${ICINGA2USER} \ ICINGA2GROUP=${ICINGA2GROUP} \ WWWGRP=${WWWGRP} # Config files with references to "Linux" LINUX_CONFIG= groups.conf services.conf hosts.conf MYSQL_USE= mysql=yes PGSQL_USES= pgsql OPTIONS_SUB= yes .include .if ! ${PORT_OPTIONS:MMYSQL} && ! ${PORT_OPTIONS:MPGSQL} PLIST_SUB+= DBBACKEND="@comment " .else PLIST_SUB+= DBBACKEND="" .endif .if ${OSVERSION} < 1000033 BUILD_DEPENDS+= flex>=2.5.31:${PORTSDIR}/textproc/flex CMAKE_ARGS+= -DFLEX_EXECUTABLE:STRING=${LOCALBASE}/bin/flex CXXFLAGS+= -I${LOCALBASE}/include/flex .endif post-patch: .for f in ${LINUX_CONFIG} ${REINPLACE_CMD} 's,[Ll]inux,FreeBSD,g' ${WRKSRC}/etc/icinga2/conf.d/${f} .endfor pre-install: ${FIND} ${WRKSRC}/etc -type f -name "*.conf" -exec ${MV} {} {}.sample \; ${FIND} ${WRKSRC}/itl -type f -name "*.conf" -exec ${MV} {} {}.sample \; ${FIND} ${WRKSRC}/etc/icinga2/scripts -type f -name "*.sh" \ -exec ${MV} {} {}.sample \; .include Index: head/net-mgmt/icinga2/distinfo =================================================================== --- head/net-mgmt/icinga2/distinfo (revision 396646) +++ head/net-mgmt/icinga2/distinfo (revision 396647) @@ -1,2 +1,2 @@ -SHA256 (icinga-icinga2-v2.3.9_GH0.tar.gz) = af6aa49ac9ce90e2ecf331b092624f5d6462d31ca5b4458db1c3d974391183c3 -SIZE (icinga-icinga2-v2.3.9_GH0.tar.gz) = 829706 +SHA256 (icinga-icinga2-v2.3.10_GH0.tar.gz) = d29880b1adfd21d650a72e04a36e4dadb899b8452c4917e25e7ec3c5e65582c1 +SIZE (icinga-icinga2-v2.3.10_GH0.tar.gz) = 830680 Index: head/net-mgmt/icinga2/files/icinga2.in =================================================================== --- head/net-mgmt/icinga2/files/icinga2.in (revision 396646) +++ head/net-mgmt/icinga2/files/icinga2.in (revision 396647) @@ -1,111 +1,115 @@ #!/bin/sh # # $FreeBSD$ # # PROVIDE: icinga2 # REQUIRE: LOGIN # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf to enable icinga2: # icinga2_enable (bool): Set to "NO" by default. # Set it to "YES" to enable icinga2. # icinga2_flags (str): Set to "" by default. # icinga2_configfile (str): Set to "%%PREFIX%%/etc/icinga2/icinga2.cfg" by default. # . /etc/rc.subr # Add /usr/local/bin to path, so that the notification scripts # can work (#!/usr/bin/env bash) export PATH=$PATH:%%LOCALBASE%%/bin name="icinga2" rcvar=icinga2_enable load_rc_config "${name}" : ${icinga2_enable:="NO"} : ${icinga2_configfile="%%PREFIX%%/etc/${name}/${name}.conf"} command="%%PREFIX%%/sbin/${name}" extra_commands="reload checkconfig configtest" icinga2_user="%%ICINGA2USER%%" icinga2_group="%%ICINGA2GROUP%%" icinga2_cachedir="/var/cache/${name}" icinga2_libdir="/var/lib/${name}" icinga2_logdir="%%ICINGA2LOGDIR%%" icinga2_rundir="/var/run/${name}" icinga2_spooldir="/var/spool/${name}" pidfile="${icinga2_rundir}/${name}.pid" icinga2_logfile="${icinga2_logdir}/${name}.log" icinga2_errorlogfile="${icinga2_logdir}/error.log" start_cmd="start_cmd" start_precmd="start_precmd" restart_precmd="icinga2_checkconfig" reload_precmd="reload_precmd" checkconfig_cmd="icinga2_checkconfig verbose" configtest_cmd="${checkconfig_cmd}" sig_reload=HUP required_files="${icinga2_configfile}" command_args="daemon -d -e ${icinga2_errorlogfile} -c ${icinga2_configfile}" icinga2_checkconfig() { echo -n "Performing sanity check of icinga2 configuration: " if [ "$1" != "verbose" ]; then quietredir="2>&1 >/dev/null" fi ${command} daemon -c ${icinga2_configfile} -C if [ $? -ne 0 ]; then echo "FAILED" return 1 else echo "OK" fi } reload_precmd() { if ! icinga2_checkconfig; then return 1 fi } start_precmd() { -# # Create necessary directories / change ownership -# for d in "${icinga2_logdir}" "${icinga2_logdir}/compat" \ -# "${icinga2_logdir}/compat/archives" "${icinga2_libdir}" \ -# "${icinga2_spooldir}" "${icinga2_spooldir}/tmp" \ -# "${icinga2_rundir}" "${icinga2_cachedir}"; do -# if [ ! -d "${d}" ]; then -# install -d -o ${icinga2_user} -g ${icinga2_group} "${d}" -# else -# chown ${icinga2_user}:${icinga2_group} "${d}" -# fi -# done -# -# install -d -o ${icinga2_user} -g %%WWWGRP%% "${icinga2_rundir}/cmd" -# -# chown -R ${icinga2_user}:${icinga2_user} "${icinga2_libdir}" -# chown -R ${icinga2_user}:${icinga2_user} "${icinga2_spooldir}" + # Create necessary directories / change ownership + # + # While this is also done through pkg-plist, /var might be on a ramdisk, + # so make sure all needed files and directories are created before starting + # Icinga. + for d in "${icinga2_logdir}" "${icinga2_logdir}/compat" \ + "${icinga2_logdir}/compat/archives" "${icinga2_libdir}" \ + "${icinga2_spooldir}" "${icinga2_spooldir}/tmp" \ + "${icinga2_rundir}" "${icinga2_cachedir}"; do + if [ ! -d "${d}" ]; then + install -d -o ${icinga2_user} -g ${icinga2_group} "${d}" + else + chown ${icinga2_user}:${icinga2_group} "${d}" + fi + done + + install -d -o ${icinga2_user} -g %%WWWGRP%% "${icinga2_rundir}/cmd" + + chown -R ${icinga2_user}:${icinga2_user} "${icinga2_libdir}" + chown -R ${icinga2_user}:${icinga2_user} "${icinga2_spooldir}" if ! icinga2_checkconfig; then return 1 fi if [ ! -f "${icinga2_logfile}" ]; then install -o "${icinga2_user}" -g "${icinga2_group}" -m 644 /dev/null "${icinga2_logfile}" fi } start_cmd() { ${command} ${command_args} } run_rc_command "$1"