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