bigtop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject [2/2] bigtop git commit: BIGTOP-2321. Add packaging code for HAWQ
Date Sat, 05 Mar 2016 04:24:21 GMT
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/63c6d139
Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/63c6d139
Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/63c6d139

Branch: refs/heads/BIGTOP-2320
Commit: 63c6d1399b5c9c116011f123daf07a4f4107c6c8
Parents: 421027f
Author: Konstantin Boudnik <cos@apache.org>
Authored: Sat Feb 27 12:12:45 2016 -0800
Committer: Konstantin Boudnik <cos@apache.org>
Committed: Fri Mar 4 20:24:04 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/deb/hawq/rules              |  3 +-
 bigtop-packages/src/rpm/hawq/SPECS/hawq.spec    | 11 ++--
 5 files changed, 137 insertions(+), 69 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/bigtop/blob/63c6d139/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/63c6d139/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/63c6d139/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/63c6d139/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/63c6d139/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..571e69b 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}-master
+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
 


Mime
View raw message