-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhive-metastore
65 lines (52 loc) · 1.17 KB
/
hive-metastore
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
#
# /etc/rc.d/init.d/hive-metastore
#
# Start hive-metastore service
#
# chkconfig: 35 90 90
# description: Start hive-metastore service
##
## hive-metastore rc script for RHEL/CentOS
##
## Author
## Jae Lee <otooiland at gmail period com>
##
## Version
## 1.0
##
## Usage
## hive-metastore {start|stop|restart}
##
# Source function library.
. /etc/rc.d/init.d/functions
PROG=hive-metastore
HIVE_PATH=/usr/local/hive
HIVE_USER=etretat
hive-metastore_start() {
su - $HIVE_USER $HIVE_PATH/bin/hive --service metastore 2>/dev/null 1>&2 &
}
hive-metastore_stop() {
kill -9 `ps -ef | grep hive | grep -v grep | awk '{print $2}'` 2>/dev/null 1>&2
}
start() {
action "Starting hive-metastore services ..." hive-metastore_start
}
stop() {
action "Stopping hive-metastore services ..." hive-metastore_stop
}
case "$1" in
start) start
;;
stop) stop
;;
restart) stop
start
;;
*) echo "Usage: service $PROG {start|stop|restart}" 1>&2
;;
esac
# ;;; Local Variables: ***
# ;;; mode: shell-script ***
# ;;; indent-tabs-mode: nil ***
# ;;; End: ***