06d41ea4c5
Ganglia provides a complete real-time monitoring and execution environment that is in use by hundreds of universities, private and government laboratories and commercial cluster implementors around the world. Whether you want to monitor hundreds of computers in real-time across a university campus or around the world, ganglia is for you. PR: ports/48551 Submitted by: Brooks Davis <brooks@freebsd.org>
57 lines
1.1 KiB
Bash
57 lines
1.1 KiB
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
# Start or stop gmond.
|
|
#
|
|
|
|
rc_file=${0##*/}
|
|
rc_arg=$1
|
|
|
|
if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/${rc_file}\$"); then
|
|
echo "${rc_file}: Cannot determine PREFIX." >&2
|
|
echo "Please use the complete pathname." >&2
|
|
exit 64
|
|
fi
|
|
|
|
program_dir=${PREFIX}/sbin
|
|
program_file=gmond
|
|
program_path=${program_dir}/${program_file}
|
|
|
|
config_dir=${PREFIX}/etc
|
|
config_file=${program_file}.conf
|
|
config_path=${config_dir}/${config_file}
|
|
|
|
syslog_facility=daemon.err
|
|
|
|
case "$rc_arg" in
|
|
start)
|
|
if [ ! -x ${program_path} ]; then
|
|
logger -sp ${syslog_facility} -t ${program_file} \
|
|
"unable to start: ${program_path} is missing."
|
|
exit 72
|
|
fi
|
|
if [ ! -f ${config_path} ]; then
|
|
logger -sp ${syslog_facility} -t ${program_file} \
|
|
"unable to start: ${config_path} is missing."
|
|
exit 72
|
|
fi
|
|
${program_path} && echo -n " ${program_file}"
|
|
;;
|
|
stop)
|
|
killall ${program_file} 2> /dev/null
|
|
;;
|
|
restart)
|
|
$0 stop
|
|
$0 start
|
|
;;
|
|
status)
|
|
ps -auxww | egrep ${program_file} | egrep -v "($0|egrep)"
|
|
;;
|
|
*)
|
|
echo "usage: ${rc_file} {start|stop|restart|status}" >&2
|
|
exit 64
|
|
;;
|
|
esac
|
|
|
|
exit 0
|