bigtop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject [1/2] bigtop git commit: BIGTOP-2321. Add packaging code for HAWQ [Forced Update!]
Date Mon, 07 Mar 2016 22:44:33 GMT
Repository: bigtop
Updated Branches:
  refs/heads/BIGTOP-2320 1da8f0ae5 -> cfc9e1469 (forced update)


BIGTOP-2321. Add packaging code for HAWQ

Adding hawq-segment service


Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo
Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/0b534ac8
Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/0b534ac8
Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/0b534ac8

Branch: refs/heads/BIGTOP-2320
Commit: 0b534ac8d5723409c18e28258d3a4d66dab92b6f
Parents: 421027f
Author: Konstantin Boudnik <cos@apache.org>
Authored: Sat Feb 27 12:12:45 2016 -0800
Committer: Konstantin Boudnik <cos@apache.org>
Committed: Mon Mar 7 14:44:24 2016 -0800

----------------------------------------------------------------------
 bigtop-packages/src/common/hawq/hawq-master.svc | 64 ++++++++++++++++++++
 .../src/common/hawq/hawq-segment.svc            | 64 ++++++++++++++++++++
 bigtop-packages/src/common/hawq/hawq.svc        | 64 --------------------
 bigtop-packages/src/common/hawq/install_hawq.sh |  2 +-
 bigtop-packages/src/deb/hawq/rules              |  3 +-
 bigtop-packages/src/rpm/hawq/SPECS/hawq.spec    | 12 ++--
 6 files changed, 139 insertions(+), 70 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/bigtop/blob/0b534ac8/bigtop-packages/src/common/hawq/hawq-master.svc
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/common/hawq/hawq-master.svc b/bigtop-packages/src/common/hawq/hawq-master.svc
new file mode 100644
index 0000000..bd60980
--- /dev/null
+++ b/bigtop-packages/src/common/hawq/hawq-master.svc
@@ -0,0 +1,64 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+DAEMON="hawq master"
+DESC="hawq master daemon"
+EXEC_PATH="\${HAWQ_HOME}/bin/hawq"
+SVC_USER="hawq"
+PIDFILE="\${HAWQ_PID_DIR}/${DAEMON}.pid"
+SVC_OPTS="-l \${HAWQ_LOG_DIR}"
+
+generate_start() {
+
+cat <<'__EOT__'
+start() {
+    [ -x $EXEC_PATH ] || exit $ERROR_PROGRAM_NOT_INSTALLED
+    log_success_msg "Starting $DESC (${DAEMON}): "
+
+    checkstatusofproc
+    status=$?
+    if [ "$status" -eq "$STATUS_RUNNING" ]; then
+        log_success_msg "${DESC} is running"
+        exit 0
+    fi
+
+    su -s /bin/bash ${SVC_USER} -c "${EXEC_PATH} start master $SVC_OPTS"
+
+    checkstatusofproc
+    RETVAL=$?
+    [ $RETVAL -eq $STATUS_RUNNING ] && touch $LOCKFILE
+    return $RETVAL
+}
+__EOT__
+
+}
+
+generate_stop() {
+
+cat <<'__EOT__'
+stop() {
+    log_success_msg "Stopping $DESC (${DAEMON}): "
+
+    su -s /bin/bash ${SVC_USER} -c "${EXEC_PATH} stop master $SVC_OPTS"
+
+    sleep 3
+    RETVAL=$?
+
+    [ $RETVAL -eq $RETVAL_SUCCESS ] && rm -f $LOCKFILE $PIDFILE
+    return $RETVAL
+}
+__EOT__
+
+}

http://git-wip-us.apache.org/repos/asf/bigtop/blob/0b534ac8/bigtop-packages/src/common/hawq/hawq-segment.svc
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/common/hawq/hawq-segment.svc b/bigtop-packages/src/common/hawq/hawq-segment.svc
new file mode 100644
index 0000000..0b4acab
--- /dev/null
+++ b/bigtop-packages/src/common/hawq/hawq-segment.svc
@@ -0,0 +1,64 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+DAEMON="hawq segment"
+DESC="hawq segment daemon"
+EXEC_PATH="\${HAWQ_HOME}/bin/hawq"
+SVC_USER="hawq"
+PIDFILE="\${HAWQ_PID_DIR}/${DAEMON}.pid"
+SVC_OPTS="-l \${HAWQ_LOG_DIR}"
+
+generate_start() {
+
+cat <<'__EOT__'
+start() {
+    [ -x $EXEC_PATH ] || exit $ERROR_PROGRAM_NOT_INSTALLED
+    log_success_msg "Starting $DESC (${DAEMON}): "
+
+    checkstatusofproc
+    status=$?
+    if [ "$status" -eq "$STATUS_RUNNING" ]; then
+        log_success_msg "${DESC} is running"
+        exit 0
+    fi
+
+    su -s /bin/bash ${SVC_USER} -c "${EXEC_PATH} start segment $SVC_OPTS"
+
+    checkstatusofproc
+    RETVAL=$?
+    [ $RETVAL -eq $STATUS_RUNNING ] && touch $LOCKFILE
+    return $RETVAL
+}
+__EOT__
+
+}
+
+generate_stop() {
+
+cat <<'__EOT__'
+stop() {
+    log_success_msg "Stopping $DESC (${DAEMON}): "
+
+    su -s /bin/bash ${SVC_USER} -c "${EXEC_PATH} stop segment $SVC_OPTS"
+
+    sleep 3
+    RETVAL=$?
+
+    [ $RETVAL -eq $RETVAL_SUCCESS ] && rm -f $LOCKFILE $PIDFILE
+    return $RETVAL
+}
+__EOT__
+
+}

http://git-wip-us.apache.org/repos/asf/bigtop/blob/0b534ac8/bigtop-packages/src/common/hawq/hawq.svc
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/common/hawq/hawq.svc b/bigtop-packages/src/common/hawq/hawq.svc
deleted file mode 100644
index 735c82e..0000000
--- a/bigtop-packages/src/common/hawq/hawq.svc
+++ /dev/null
@@ -1,64 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-DAEMON="hawq"
-DESC="hawq daemon"
-EXEC_PATH="\${HAWQ_HOME}/bin/hawq"
-SVC_USER="hawq"
-PIDFILE="\${HAWQ_PID_DIR}/${DAEMON}.pid"
-SVC_OPTS="-l \${HAWQ_LOG_DIR}"
-
-generate_start() {
-
-cat <<'__EOT__'
-start() {
-    [ -x $EXEC_PATH ] || exit $ERROR_PROGRAM_NOT_INSTALLED
-    log_success_msg "Starting $DESC (${DAEMON}): "
-
-    checkstatusofproc
-    status=$?
-    if [ "$status" -eq "$STATUS_RUNNING" ]; then
-        log_success_msg "${DESC} is running"
-        exit 0
-    fi
-
-    su -s /bin/bash ${SVC_USER} -c "${EXEC_PATH} start master $SVC_OPTS"
-
-    checkstatusofproc
-    RETVAL=$?
-    [ $RETVAL -eq $STATUS_RUNNING ] && touch $LOCKFILE
-    return $RETVAL
-}
-__EOT__
-
-}
-
-generate_stop() {
-
-cat <<'__EOT__'
-stop() {
-    log_success_msg "Stopping $DESC (${DAEMON}): "
-
-    su -s /bin/bash ${SVC_USER} -c "${EXEC_PATH} stop master $SVC_OPTS"
-
-    sleep 3
-    RETVAL=$?
-
-    [ $RETVAL -eq $RETVAL_SUCCESS ] && rm -f $LOCKFILE $PIDFILE
-    return $RETVAL
-}
-__EOT__
-
-}

http://git-wip-us.apache.org/repos/asf/bigtop/blob/0b534ac8/bigtop-packages/src/common/hawq/install_hawq.sh
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/common/hawq/install_hawq.sh b/bigtop-packages/src/common/hawq/install_hawq.sh
index af58ec6..85b94c8 100755
--- a/bigtop-packages/src/common/hawq/install_hawq.sh
+++ b/bigtop-packages/src/common/hawq/install_hawq.sh
@@ -129,7 +129,7 @@ cp -ar $UNZIP_DIR/../libyarn/* $PREFIX/$LIB_DIR
 sed -i -e 's#source %s/greenplum_path.sh" % hawq_home#source /etc/default/hawq#' $PREFIX/$BIN_DIR/hawq
 ln -s $ETC_DIR/conf $PREFIX/$LIB_DIR/config
 ## HAWQ-422 configs are expected to sit in this hardcoded locations ;(
-ln -s $PREFIX/$LIB_DIR/config $PREFIX/$LIB_DIR/etc
+ln -s $ETC_DIR/conf $PREFIX/$LIB_DIR/etc
 # HAWQ-421
 ln -s $ETC_DIR/default/hawq $PREFIX/$LIB_DIR/greenplum_path.sh
 

http://git-wip-us.apache.org/repos/asf/bigtop/blob/0b534ac8/bigtop-packages/src/deb/hawq/rules
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/deb/hawq/rules b/bigtop-packages/src/deb/hawq/rules
index 7a7640b..1e256a1 100755
--- a/bigtop-packages/src/deb/hawq/rules
+++ b/bigtop-packages/src/deb/hawq/rules
@@ -43,7 +43,8 @@ override_dh_auto_install:
 		--prefix=debian/tmp
 	ln -s /var/log/${hawq_pkg_name} debian/tmp/usr/lib/${hawq_pkg_name}/logs
 	ln -s /var/run/${hawq_pkg_name} debian/tmp/usr/lib/${hawq_pkg_name}/pids
-	bash debian/init.d.tmpl debian/hawq.svc deb debian/${hawq_pkg_name}-service.init
+	bash debian/init.d.tmpl debian/hawq-master.svc deb debian/${hawq_pkg_name}-master-service.init
+	bash debian/init.d.tmpl debian/hawq-segment.svc deb debian/${hawq_pkg_name}-segment-service.init
 
 ## Let's override the auto_configure and auto_clean to make sure existing
 ## top-level Makefile doesn't interfere with the package creation

http://git-wip-us.apache.org/repos/asf/bigtop/blob/0b534ac8/bigtop-packages/src/rpm/hawq/SPECS/hawq.spec
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/rpm/hawq/SPECS/hawq.spec b/bigtop-packages/src/rpm/hawq/SPECS/hawq.spec
index 81f82ef..84c597a 100644
--- a/bigtop-packages/src/rpm/hawq/SPECS/hawq.spec
+++ b/bigtop-packages/src/rpm/hawq/SPECS/hawq.spec
@@ -82,9 +82,10 @@ License: APL2
 Source0: %{vcs_tag}.tar.gz
 Source1: do-component-build
 Source2: install_hawq.sh
-Source3: hawq.svc
+Source3: hawq-master.svc
 Source4: init.d.tmpl
 Source5: hawq.default
+Source6: hawq-segment.svc
 Requires: coreutils, /usr/sbin/useradd, /sbin/chkconfig, /sbin/service
 Requires: hadoop-hdfs, bigtop-utils >= 1.0
 
@@ -131,9 +132,11 @@ ln -s %{_localstatedir}/log/%{name} %{buildroot}/%{logs_hawq}
 %__install -d  -m 0755  %{buildroot}/%{_localstatedir}/run/%{name}
 ln -s %{_localstatedir}/run/%{name} %{buildroot}/%{pids_hawq}
 
-init_file=$RPM_BUILD_ROOT/%{initd_dir}/%{name}
-bash %{SOURCE4} ${RPM_SOURCE_DIR}/hawq.svc rpm $init_file
-chmod 755 $init_file
+master_init_file=$RPM_BUILD_ROOT/%{initd_dir}/%{name}
+segment_init_file=$RPM_BUILD_ROOT/%{initd_dir}/%{name}-segment
+bash %{SOURCE4} ${RPM_SOURCE_DIR}/%{SOURCE3} rpm $master_init_file
+bash %{SOURCE4} ${RPM_SOURCE_DIR}/%{SOURCE6} rpm $segment_init_file
+chmod 755 $master_init_file $segment_init_file
 
 %__install -d -m 0755 $RPM_BUILD_ROOT/usr/bin
 
@@ -167,6 +170,7 @@ fi
 %files
 %defattr(-,hawq,hawq)
 %attr(0755,root,root)/%{initd_dir}/%{name}
+%attr(0755,root,root)/%{initd_dir}/%{name}-segment
 %dir %{_localstatedir}/log/%{name}
 %dir %{_localstatedir}/run/%{name}
 


Mime
View raw message