diff options
Diffstat (limited to 'net-mgmt/zabbix5-server/files/zabbix_agentd.in')
-rw-r--r-- | net-mgmt/zabbix5-server/files/zabbix_agentd.in | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/net-mgmt/zabbix5-server/files/zabbix_agentd.in b/net-mgmt/zabbix5-server/files/zabbix_agentd.in index d3ac5102f812..5fa104126dbe 100644 --- a/net-mgmt/zabbix5-server/files/zabbix_agentd.in +++ b/net-mgmt/zabbix5-server/files/zabbix_agentd.in @@ -39,15 +39,18 @@ stop_precmd=zabbix_agentd_precmd zabbix_agentd_precmd() { + pidfile=${zabbix_agentd_pidfile} if get_pidfile_from_conf PidFile ${zabbix_agentd_config}; then pidfile="$_pidfile_from_conf" - else - pidfile=${zabbix_agentd_pidfile} - local rundir=${zabbix_agentd_pidfile%/*} - if [ ! -d $rundir ] ; then - install -d -m 0755 -o zabbix -g zabbix $rundir - fi fi + logfile=/var/log/zabbix/zabbix_agentd.log + if get_pidfile_from_conf LogFile ${zabbix_agentd_config}; then + logfile="$_pidfile_from_conf" + fi + local rundir=${pidfile%/*} + local logdir=${logfile%/*} + [ -d $rundir ] || install -d -m 0755 -o zabbix -g zabbix $rundir + [ -d $logdir ] || install -d -m 0755 -o zabbix -g zabbix $logdir # This shouldn't be necessary with pidfile, but empirically it was the # only way to reap the parent PID instead of all PIDs from |