38 lines
737 B
Bash
38 lines
737 B
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
# PROVIDE: zkfc
|
|
# REQUIRE: LOGIN
|
|
# KEYWORD: shutdown
|
|
#
|
|
# zkfc_enable (bool): Set to NO by default.
|
|
# Set it to YES to enable zkfc.
|
|
|
|
. /etc/rc.subr
|
|
|
|
export PATH=${PATH}:%%LOCALBASE%%/bin
|
|
name=zkfc
|
|
rcvar=zkfc_enable
|
|
|
|
load_rc_config "${name}"
|
|
|
|
: ${zkfc_enable:=NO}
|
|
: ${zkfc_user:=%%HDFS_USER%%}
|
|
|
|
command="%%PREFIX%%/sbin/hadoop-daemon.sh"
|
|
command_interpreter_execution="%%JAVA_HOME%%/bin/java"
|
|
command_args='--config %%ETCDIR%% start zkfc'
|
|
|
|
stop_cmd=zkfc_stop
|
|
status_precmd=find_pid
|
|
|
|
zkfc_stop () {
|
|
su -m ${zkfc_user} -c "${command} --config %%ETCDIR%% stop zkfc"
|
|
}
|
|
|
|
find_pid () {
|
|
rc_pid=$(check_pidfile $pidfile $command_interpreter_execution)
|
|
}
|
|
|
|
run_rc_command "$1"
|