Source
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
static int parent_pid = -1;
/* pointer to function for getting caller's PID file location */
static zbx_get_config_str_f get_pid_file_pathname_cb = NULL;
static zbx_get_threads_f get_threads_func_cb;
static zbx_get_config_int_f get_threads_num_func_cb;
static zbx_signal_handler_f sigusr_handler;
static zbx_signal_redirect_f signal_redirect_handler;
/******************************************************************************
* *
* Purpose: common SIGUSR1 handler for Zabbix processes *
* *
******************************************************************************/
static void common_sigusr_handler(int flags)
{
switch (ZBX_RTC_GET_MSG(flags))
{
case ZBX_RTC_LOG_LEVEL_INCREASE:
zabbix_increase_log_level();
break;
case ZBX_RTC_PROF_ENABLE:
zbx_prof_enable(ZBX_RTC_GET_SCOPE(flags));
break;
case ZBX_RTC_PROF_DISABLE:
zbx_prof_disable();
break;
case ZBX_RTC_LOG_LEVEL_DECREASE:
zabbix_decrease_log_level();
break;
default: