mirror of
https://git.freebsd.org/ports.git
synced 2025-06-20 04:00:41 -04:00
38 lines
896 B
Bash
38 lines
896 B
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
# PROVIDE: metastore
|
|
# REQUIRE: LOGIN
|
|
# KEYWORD: shutdown
|
|
#
|
|
# metastore_enable (bool): Set to NO by default.
|
|
# Set it to YES to enable Hive metastore service.
|
|
|
|
. /etc/rc.subr
|
|
|
|
export PATH=${PATH}:%%LOCALBASE%%/bin
|
|
name=metastore
|
|
rcvar=metastore_enable
|
|
pidfile=%%HIVE_RUNDIR%%/${name}.pid
|
|
|
|
load_rc_config "${name}"
|
|
|
|
: ${metastore_enable:=NO}
|
|
|
|
start_cmd="metastore_start"
|
|
stop_cmd="metastore_stop"
|
|
command="%%PREFIX%%/hive/bin/hive"
|
|
|
|
metastore_start() {
|
|
su -m %%HIVE_USER%% -c "HADOOP_OPTS=\"-Dhive.log.dir=%%HIVE_LOGDIR%% -Dhive.log.file=metastore.log -Dhive.log.threshold=INFO\" $command --service ${name} > %%HIVE_LOGDIR%%/$name.out 2>&1 < /dev/null & "' echo $! '"> $pidfile"
|
|
}
|
|
|
|
metastore_stop() {
|
|
rc_pid=$(check_pidfile ${pidfile} %%JAVA_HOME%%/bin/java)
|
|
if [ -n "$rc_pid" ]; then
|
|
kill $rc_pid
|
|
fi
|
|
}
|
|
|
|
run_rc_command "$1"
|