mirror of
https://git.freebsd.org/ports.git
synced 2025-06-01 10:56:27 -04:00
code in the source tree. Refactor the gmond rc.d script to allow multiple gmond daemons to be run by making links to the script. For example a link to gmond-cluster would let you set gmond_cluster_enable and gmond_cluster_conf variables to control a second instance.
27 lines
481 B
Bash
27 lines
481 B
Bash
#!/bin/sh
|
|
# $FreeBSD$
|
|
|
|
# PROVIDE: gmond
|
|
# REQUIRE: DAEMON
|
|
# KEYWORD: shutdown
|
|
|
|
bname=`basename $0`
|
|
|
|
. /etc/rc.subr
|
|
|
|
name=`echo "${bname}" | tr ".-" "__"`
|
|
rcvar=`set_rcvar`
|
|
command="%%PREFIX%%/sbin/gmond"
|
|
|
|
load_rc_config ganglia
|
|
|
|
load_rc_config $bname
|
|
|
|
eval "${name}_enable=\${${name}_enable-NO}"
|
|
eval "conffile=\${${name}_conf-%%PREFIX%%/etc/${bname}.conf}"
|
|
|
|
pidfile="/var/run/${bname}.pid"
|
|
command_args="-c ${conffile} -p ${pidfile}"
|
|
required_files=${conffile}
|
|
|
|
run_rc_command $*
|