#!/bin/sh
#
# $FreeBSD: head/devel/hadoop2/files/webappproxyserver.in 364992 2014-08-15 16:20:28Z demon $
#
# PROVIDE: webappproxyserver
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# webappproxyserver_enable (bool):  Set to NO by default.
#                                   Set it to YES to enable webappproxyserver.

. /etc/rc.subr

export PATH=${PATH}:/usr/local/bin
name=webappproxyserver
rcvar=webappproxyserver_enable

load_rc_config "${name}"

: ${webappproxyserver_enable:=NO}
: ${webappproxyserver_user:=mapred}

command="/usr/local/sbin/yarn-daemon.sh"
command_args='--config /usr/local/etc/hadoop start proxyserver'

stop_cmd=webappproxyserver_stop

webappproxyserver_stop () {
  su -m ${webappproxyserver_user} -c "${command} --config /usr/local/etc/hadoop stop proxyserver"
}

run_rc_command "$1"
