freebsd-ports/devel/hadoop2/files/journalnode.in
Dmitry Sivachenko cc6b239238 Fix 'status' argument for rc-scripts.
PR:		208639
Submitted by:	xmj
2016-04-27 14:52:41 +00:00

38 lines
814 B
Bash

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