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