You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bigtop.apache.org by iw...@apache.org on 2022/10/31 11:37:34 UTC
[bigtop] branch master updated: BIGTOP-3857: Support parent directory default configuration for Hadoop rpm (#1046)
This is an automated email from the ASF dual-hosted git repository.
iwasakims pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bigtop.git
The following commit(s) were added to refs/heads/master by this push:
new 17cebb2e BIGTOP-3857: Support parent directory default configuration for Hadoop rpm (#1046)
17cebb2e is described below
commit 17cebb2eec1df455dc3035b19e15765e127a76e0
Author: Yu Hou <52...@qq.com>
AuthorDate: Mon Oct 31 19:37:27 2022 +0800
BIGTOP-3857: Support parent directory default configuration for Hadoop rpm (#1046)
---
bigtop-packages/src/common/hadoop/hadoop.default | 23 ----------------
.../src/common/hadoop/install_hadoop.sh | 32 ++++++++++++++++++++++
bigtop-packages/src/deb/hadoop/rules | 4 +--
bigtop-packages/src/rpm/hadoop/SPECS/hadoop.spec | 6 +---
4 files changed, 34 insertions(+), 31 deletions(-)
diff --git a/bigtop-packages/src/common/hadoop/hadoop.default b/bigtop-packages/src/common/hadoop/hadoop.default
deleted file mode 100644
index 3a7ce859..00000000
--- a/bigtop-packages/src/common/hadoop/hadoop.default
+++ /dev/null
@@ -1,23 +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.
-export HADOOP_HOME=/usr/lib/hadoop
-
-export HADOOP_LIBEXEC_DIR=/usr/lib/hadoop/libexec
-export HADOOP_CONF_DIR=/etc/hadoop/conf
-
-export HADOOP_COMMON_HOME=/usr/lib/hadoop
-export HADOOP_HDFS_HOME=/usr/lib/hadoop-hdfs
-export HADOOP_MAPRED_HOME=/usr/lib/hadoop-mapreduce
-export HADOOP_YARN_HOME=/usr/lib/hadoop-yarn
diff --git a/bigtop-packages/src/common/hadoop/install_hadoop.sh b/bigtop-packages/src/common/hadoop/install_hadoop.sh
index bdcdab21..cabfa01d 100755
--- a/bigtop-packages/src/common/hadoop/install_hadoop.sh
+++ b/bigtop-packages/src/common/hadoop/install_hadoop.sh
@@ -332,6 +332,38 @@ sed -i -e '/^[^#]/s,^,#,' ${BUILD_DIR}/etc/hadoop/hadoop-env.sh
cp -r ${BUILD_DIR}/etc/hadoop/* $PREFIX/$ETC_HADOOP/conf.empty
rm -rf $PREFIX/$ETC_HADOOP/conf.empty/*.cmd
+# Install default wrapper
+install -d -m 0755 $PREFIX/$ETC_DEFAULT
+default_hadoop_wrapper=$PREFIX/$ETC_DEFAULT/hadoop
+cat > $default_hadoop_wrapper << EOF
+# 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.
+export HADOOP_HOME=${HADOOP_DIR}
+
+export HADOOP_LIBEXEC_DIR=${HADOOP_DIR}/libexec
+export HADOOP_CONF_DIR=/etc/hadoop/conf
+
+export HADOOP_COMMON_HOME=${HADOOP_DIR}
+export HADOOP_HDFS_HOME=${HDFS_DIR}
+export HADOOP_MAPRED_HOME=${MAPREDUCE_DIR}
+export HADOOP_YARN_HOME=${YARN_DIR}
+export JSVC_HOME=/usr/lib/bigtop-utils
+EOF
+
+chmod 644 $default_hadoop_wrapper
+
# docs
install -d -m 0755 $PREFIX/$DOC_DIR
cp -r ${BUILD_DIR}/share/doc/* $PREFIX/$DOC_DIR/
diff --git a/bigtop-packages/src/deb/hadoop/rules b/bigtop-packages/src/deb/hadoop/rules
index 84f060c6..fe0ba5ec 100755
--- a/bigtop-packages/src/deb/hadoop/rules
+++ b/bigtop-packages/src/deb/hadoop/rules
@@ -66,9 +66,7 @@ override_dh_auto_install:
# Workaround for BIGTOP-583
rm -f debian/tmp/usr/lib/hadoop-*/lib/slf4j-log4j12-*.jar
# FIXME: BIGTOP-463
- mkdir -p debian/tmp/etc/default
- echo 'export JSVC_HOME=/usr/lib/bigtop-utils' >> debian/hadoop.default
- cp debian/hadoop.default debian/tmp/etc/default/hadoop
+ # mkdir -p debian/tmp/etc/default
# Refactored from install-arch
cp debian/hadoop-fuse.default debian/tmp/etc/default/hadoop-fuse
mkdir -p debian/tmp/etc/security/limits.d
diff --git a/bigtop-packages/src/rpm/hadoop/SPECS/hadoop.spec b/bigtop-packages/src/rpm/hadoop/SPECS/hadoop.spec
index 09cf20fb..e57d98ec 100644
--- a/bigtop-packages/src/rpm/hadoop/SPECS/hadoop.spec
+++ b/bigtop-packages/src/rpm/hadoop/SPECS/hadoop.spec
@@ -148,7 +148,6 @@ Group: Development/Libraries
Source0: %{name}-%{hadoop_base_version}.tar.gz
Source1: do-component-build
Source2: install_%{name}.sh
-Source3: hadoop.default
Source4: hadoop-fuse.default
Source5: httpfs.default
Source6: hadoop.1
@@ -577,10 +576,7 @@ env HADOOP_VERSION=%{hadoop_base_version} bash %{SOURCE2} \
%__install -d -m 0755 $RPM_BUILD_ROOT/%{initd_dir}/
# Install top level /etc/default files
-%__install -d -m 0755 $RPM_BUILD_ROOT/%{etc_default}
-%__cp $RPM_SOURCE_DIR/hadoop.default $RPM_BUILD_ROOT/%{etc_default}/hadoop
-# FIXME: BIGTOP-463
-echo 'export JSVC_HOME=/usr/lib/bigtop-utils' >> $RPM_BUILD_ROOT/%{etc_default}/hadoop
+# %__install -d -m 0755 $RPM_BUILD_ROOT/%{etc_default}
%__cp $RPM_SOURCE_DIR/%{name}-fuse.default $RPM_BUILD_ROOT/%{etc_default}/%{name}-fuse
# Generate the init.d scripts