ports/net-mgmt/zabbix2-server/files/zabbix_server.in
Torsten Zuehlsdorff b2293ba503 net-mgmt/zabbix2-server: Update from 2.0.17 to 2.0.18
- updated French translation; thanks to Zabbix translators
- enforced bash usage in mysql.size user parameter configuration
  script to avoid issues with different default shells;
  thanks to Timo Lindfors for reporting it
- fixed timeout being too low when sending configuration data to
  active proxy
- fixed loss of trailing whitespace in unquoted function parameters
  when creating calculated items with low level discovery

Also:
- Fix default path to PID
- Fix rc.d scripts to correct use PID file
- Remove IGNORE_WITH_MYSQL because referenced version was removed long ago

PR:           209890
Submitted by: pg@pakhom.spb.ru (maintainer)
Approved by:  pi (mentor)
2016-09-01 09:44:43 +00:00

57 lines
1.6 KiB
Bash

#!/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_config (string): Set to the standard config file path by
# default.
# zabbix_server_pidfile (string): Location of the asterisk pid file
# Default is /var/run/zabbix/zabbix_server.pid
#
. /etc/rc.subr
name="zabbix_server"
rcvar=zabbix_server_enable
load_rc_config $name
: ${zabbix_server_enable:=NO}
: ${zabbix_server_config:=%%ETCDIR%%/${name}.conf}
: ${zabbix_server_pidfile:=/var/run/zabbix/zabbix_server.pid}
command="%%PREFIX%%/sbin/${name}"
required_files="${zabbix_server_config}"
start_precmd=zabbix_server_precmd
status_precmd=zabbix_server_precmd
stop_precmd=zabbix_server_precmd
zabbix_server_precmd()
{
if get_pidfile_from_conf PidFile ${zabbix_server_config}; then
pidfile="$_pidfile_from_conf"
else
pidfile=${zabbix_server_pidfile}
local rundir=${zabbix_server_pidfile%/*}
if [ ! -d $rundir ] ; then
install -d -m 0755 -o zabbix -g zabbix $rundir
fi
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})
}
run_rc_command "$1"