#!/bin/sh # # $FreeBSD: head/devel/hadoop/files/jobtracker.in 360157 2014-07-02 08:52:14Z demon $ # # PROVIDE: jobtracker # REQUIRE: LOGIN # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf to enable this service: # # jobtracker_enable (bool): Set to NO by default. # Set it to YES to enable jobtracker. # jobtracker_user (str): Set to %%MAPRED_USER%% by default. # Set to a valid user to change default # jobtracker user. # jobtracker_java_home (str): Unset by default. # Switch to another JVM. # # jobtracker_log_dir (str): Unset by default. # jobtracker_pid_dir (str): Unset by default. # . /etc/rc.subr name=jobtracker rcvar=jobtracker_enable load_rc_config "${name}" : ${jobtracker_enable:=NO} : ${jobtracker_user:=%%MAPRED_USER%%} : ${jobtracker_group:=%%HADOOP_GROUP%%} command="%%DATADIR%%/bin/hadoop-daemon.sh" command_args='--config ${HADOOP_CONF_DIR} start jobtracker' start_precmd=jobtracker_init stop_precmd=jobtracker_init stop_cmd=jobtracker_stop jobtracker_init() { if [ -n "${jobtracker_java_home}" ] then export JAVA_HOME="${jobtracker_java_home}" fi for f in %%ETCDIR%%/envvars.d/*.env do . ${f} done } jobtracker_stop () { su -m ${jobtracker_user} -c "${command} --config ${HADOOP_CONF_DIR} stop jobtracker" } run_rc_command "$1"