Bug 94571

Summary: Error in net-mgmt/zabbix rc.d files
Product: Ports & Packages Reporter: Guilherme Oliveira <guilherme.oliveira>
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Guilherme Oliveira 2006-03-16 17:00:31 UTC
Everything is cvsup'ed, installed and configured but rc.d script reports an error when I try to start the service.

How-To-Repeat: visionnnet# /usr/local/etc/rc.d/zabbix_suckerd start
/usr/local/etc/rc.d/zabbix_suckerd: WARNING: $zabbix_suckerd_enable is not set properly - see rc.conf(5).
visionnnet#
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2006-03-16 20:56:10 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback
Comment 2 tnt 2006-03-30 14:05:50 UTC
Same problem on FreeBSD 5.5-PRERELEASE so it's no 6.x issue.
It also happens with zabbix_agentd (the one included in the zabbix port, 
not to be mistaken with the stand-alone zabbix-agent).



----------------------------
  Problem in Windows: re-boot
  Problem in Unix: be-root
Comment 3 Pav Lucistnik freebsd_committer freebsd_triage 2006-04-01 23:18:29 UTC
State Changed
From-To: feedback->closed

This is not a bug, it's a feature. If you want to use a modern rc scripts like 
zabbix's one, you have to enable it in /etc/rc.conf, as suggested by the message.
Comment 4 Guilherme Oliveira 2006-04-03 10:42:42 UTC
Don't understand that feature but I have in rc.conf:

zabbix_suckerd_enable=3D"YES"

and it still gives the same error.
Comment 5 francisg 2006-11-03 14:01:20 UTC
Hi,

I had the same problem and fixed it easily like this:

this is the normal zabbix_agentd rc.d script:
<snip file="zabbix_agentd">
#!/bin/sh

. /etc/rc.subr


name="zabbix_agentd"
rcvar=`set_rcvar`
command="${prefix}/bin/${name}"
required_files="/etc/zabbix/${name}.conf"

run_rc_command "$1"
#
</snip>

you just need to add 2 lines there, setting the "prefix" variable to  
/usr/local and running load_rc_config before run_rc_command, resulting  
in the following:

<snip file"zabbix_agentd">
#!/bin/sh

. /etc/rc.subr


name="zabbix_agentd"
rcvar=`set_rcvar`
prefix="/usr/local"
command="${prefix}/bin/${name}"
required_files="/etc/zabbix/${name}.conf"

load_rc_config "$name"
run_rc_command "$1"
#
</snip>

doing the same for zabbix_suckerd.

should i send a diff or something?
the corrected scripts are located here:

http://fnop.net/~francisg/scripts/zabbix/

best regards,
Francisco Guerreiro