#!/bin/sh # # $FreeBSD$ # # PROVIDE: hbase_master # REQUIRE: LOGIN # KEYWORD: shutdown # # hbase_master_enable (bool): Set to NO by default. # Set it to YES to enable HBase master. . /etc/rc.subr export PATH=${PATH}:%%LOCALBASE%%/bin name=hbase_master rcvar=hbase_master_enable load_rc_config "${name}" : ${hbase_master_enable:=NO} : ${hbase_master_user:=%%HBASE_USER%%} command="%%PREFIX%%/hbase/bin/hbase-daemon.sh" command_interpreter="bash" command_args='--config %%ETCDIR%% start master' stop_cmd=hbase_master_stop hbase_master_stop () { su -m ${hbase_master_user} -c "${command} --config %%ETCDIR%% stop master" } run_rc_command "$1"