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 5fb489e28 BIGTOP-4271. Provide systemd service unit files: 
Hadoop(HDFS) (#1322)
5fb489e28 is described below

commit 5fb489e28a46f6138e963c8510619787d5a55922
Author: masatana <[email protected]>
AuthorDate: Sat Jan 11 08:26:34 2025 +0900

    BIGTOP-4271. Provide systemd service unit files: Hadoop(HDFS) (#1322)
---
 .../hadoop/hadoop-hdfs-datanode.service}           | 44 +++++++++-------------
 .../hadoop/hadoop-hdfs-dfsrouter.service}          | 44 +++++++++-------------
 .../hadoop/hadoop-hdfs-journalnode.service}        | 44 +++++++++-------------
 .../hadoop/hadoop-hdfs-namenode.service}           | 44 +++++++++-------------
 .../hadoop/hadoop-hdfs-secondarynamenode.service}  | 44 +++++++++-------------
 .../hadoop/hadoop-hdfs-zkfc.service}               | 44 +++++++++-------------
 .../hadoop/hadoop-hdfs.tmpfile}                    | 28 +-------------
 .../src/common/hadoop/install_hadoop.sh            | 26 ++++++++++++-
 bigtop-packages/src/deb/hadoop/hadoop-hdfs.install |  2 +-
 .../src/deb/hadoop/hadoop-hdfs.postinst            |  6 +--
 bigtop-packages/src/deb/hadoop/rules               |  1 -
 bigtop-packages/src/rpm/hadoop/SPECS/hadoop.spec   | 38 ++++++++++++++-----
 12 files changed, 166 insertions(+), 199 deletions(-)

diff --git a/bigtop-packages/src/deb/hadoop/hadoop-hdfs.postinst 
b/bigtop-packages/src/common/hadoop/hadoop-hdfs-datanode.service
similarity index 54%
copy from bigtop-packages/src/deb/hadoop/hadoop-hdfs.postinst
copy to bigtop-packages/src/common/hadoop/hadoop-hdfs-datanode.service
index 2d972675d..bc4a57dac 100644
--- a/bigtop-packages/src/deb/hadoop/hadoop-hdfs.postinst
+++ b/bigtop-packages/src/common/hadoop/hadoop-hdfs-datanode.service
@@ -1,5 +1,3 @@
-#!/bin/bash
-#
 # 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.
@@ -15,28 +13,22 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# postinst script for hadoop
-
-set -e
-
-case "$1" in
-    configure)
-       mkdir -p /var/log/hadoop-hdfs /var/run/hadoop-hdfs 
/var/lib/hadoop-hdfs/cache /usr/lib/hadoop/logs || :
-       chgrp -R hadoop /var/log/hadoop-hdfs /var/run/hadoop-hdfs
-       chmod g+w /var/run/hadoop-hdfs /var/log/hadoop-hdfs
-       chown hdfs:hadoop /var/lib/hadoop-hdfs/ /var/lib/hadoop-hdfs/cache
-       chmod 0755 /var/lib/hadoop-hdfs
-       chmod 1777 /var/lib/hadoop-hdfs/cache
-       chmod 1777 /usr/lib/hadoop/logs
-    ;;
-
-    abort-upgrade|abort-remove|abort-deconfigure)
-    ;;
-
-    *)
-        echo "postinst called with unknown argument \`$1'" >&2
-        exit 1
-    ;;
-esac
+[Unit]
+Documentation=https://hadoop.apache.org/
+Description=Hadoop DataNode
+Before=multi-user.target
+Before=graphical.target
+After=remote-fs.target
 
-#DEBHELPER#
+[Service]
+User=hdfs
+Group=hdfs
+Type=forking
+Restart=no
+TimeoutSec=5min
+IgnoreSIGPIPE=no
+KillMode=process
+RemainAfterExit=no
+SuccessExitStatus=5 6
+ExecStart=/usr/bin/hdfs --config /etc/hadoop/conf --daemon start datanode
+ExecStop=/usr/bin/hdfs --config /etc/hadoop/conf --daemon stop datanode
diff --git a/bigtop-packages/src/deb/hadoop/hadoop-hdfs.postinst 
b/bigtop-packages/src/common/hadoop/hadoop-hdfs-dfsrouter.service
similarity index 54%
copy from bigtop-packages/src/deb/hadoop/hadoop-hdfs.postinst
copy to bigtop-packages/src/common/hadoop/hadoop-hdfs-dfsrouter.service
index 2d972675d..a1323aa42 100644
--- a/bigtop-packages/src/deb/hadoop/hadoop-hdfs.postinst
+++ b/bigtop-packages/src/common/hadoop/hadoop-hdfs-dfsrouter.service
@@ -1,5 +1,3 @@
-#!/bin/bash
-#
 # 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.
@@ -15,28 +13,22 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# postinst script for hadoop
-
-set -e
-
-case "$1" in
-    configure)
-       mkdir -p /var/log/hadoop-hdfs /var/run/hadoop-hdfs 
/var/lib/hadoop-hdfs/cache /usr/lib/hadoop/logs || :
-       chgrp -R hadoop /var/log/hadoop-hdfs /var/run/hadoop-hdfs
-       chmod g+w /var/run/hadoop-hdfs /var/log/hadoop-hdfs
-       chown hdfs:hadoop /var/lib/hadoop-hdfs/ /var/lib/hadoop-hdfs/cache
-       chmod 0755 /var/lib/hadoop-hdfs
-       chmod 1777 /var/lib/hadoop-hdfs/cache
-       chmod 1777 /usr/lib/hadoop/logs
-    ;;
-
-    abort-upgrade|abort-remove|abort-deconfigure)
-    ;;
-
-    *)
-        echo "postinst called with unknown argument \`$1'" >&2
-        exit 1
-    ;;
-esac
+[Unit]
+Documentation=https://hadoop.apache.org/
+Description=Hadoop dfsrouter
+Before=multi-user.target
+Before=graphical.target
+After=remote-fs.target
 
-#DEBHELPER#
+[Service]
+User=hdfs
+Group=hdfs
+Type=forking
+Restart=no
+TimeoutSec=5min
+IgnoreSIGPIPE=no
+KillMode=process
+RemainAfterExit=no
+SuccessExitStatus=5 6
+ExecStart=/usr/bin/hdfs --config /etc/hadoop/conf --daemon start dfsrouter
+ExecStop=/usr/bin/hdfs --config /etc/hadoop/conf --daemon stop dfsrouter
diff --git a/bigtop-packages/src/deb/hadoop/hadoop-hdfs.postinst 
b/bigtop-packages/src/common/hadoop/hadoop-hdfs-journalnode.service
similarity index 54%
copy from bigtop-packages/src/deb/hadoop/hadoop-hdfs.postinst
copy to bigtop-packages/src/common/hadoop/hadoop-hdfs-journalnode.service
index 2d972675d..0acb1411d 100644
--- a/bigtop-packages/src/deb/hadoop/hadoop-hdfs.postinst
+++ b/bigtop-packages/src/common/hadoop/hadoop-hdfs-journalnode.service
@@ -1,5 +1,3 @@
-#!/bin/bash
-#
 # 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.
@@ -15,28 +13,22 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# postinst script for hadoop
-
-set -e
-
-case "$1" in
-    configure)
-       mkdir -p /var/log/hadoop-hdfs /var/run/hadoop-hdfs 
/var/lib/hadoop-hdfs/cache /usr/lib/hadoop/logs || :
-       chgrp -R hadoop /var/log/hadoop-hdfs /var/run/hadoop-hdfs
-       chmod g+w /var/run/hadoop-hdfs /var/log/hadoop-hdfs
-       chown hdfs:hadoop /var/lib/hadoop-hdfs/ /var/lib/hadoop-hdfs/cache
-       chmod 0755 /var/lib/hadoop-hdfs
-       chmod 1777 /var/lib/hadoop-hdfs/cache
-       chmod 1777 /usr/lib/hadoop/logs
-    ;;
-
-    abort-upgrade|abort-remove|abort-deconfigure)
-    ;;
-
-    *)
-        echo "postinst called with unknown argument \`$1'" >&2
-        exit 1
-    ;;
-esac
+[Unit]
+Documentation=https://hadoop.apache.org/
+Description=Hadoop Journalnode
+Before=multi-user.target
+Before=graphical.target
+After=remote-fs.target
 
-#DEBHELPER#
+[Service]
+User=hdfs
+Group=hdfs
+Type=forking
+Restart=no
+TimeoutSec=5min
+IgnoreSIGPIPE=no
+KillMode=process
+RemainAfterExit=no
+SuccessExitStatus=5 6
+ExecStart=/usr/bin/hdfs --config /etc/hadoop/conf --daemon start journalnode
+ExecStop=/usr/bin/hdfs --config /etc/hadoop/conf --daemon stop journalnode
diff --git a/bigtop-packages/src/deb/hadoop/hadoop-hdfs.postinst 
b/bigtop-packages/src/common/hadoop/hadoop-hdfs-namenode.service
similarity index 54%
copy from bigtop-packages/src/deb/hadoop/hadoop-hdfs.postinst
copy to bigtop-packages/src/common/hadoop/hadoop-hdfs-namenode.service
index 2d972675d..051572a84 100644
--- a/bigtop-packages/src/deb/hadoop/hadoop-hdfs.postinst
+++ b/bigtop-packages/src/common/hadoop/hadoop-hdfs-namenode.service
@@ -1,5 +1,3 @@
-#!/bin/bash
-#
 # 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.
@@ -15,28 +13,22 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# postinst script for hadoop
-
-set -e
-
-case "$1" in
-    configure)
-       mkdir -p /var/log/hadoop-hdfs /var/run/hadoop-hdfs 
/var/lib/hadoop-hdfs/cache /usr/lib/hadoop/logs || :
-       chgrp -R hadoop /var/log/hadoop-hdfs /var/run/hadoop-hdfs
-       chmod g+w /var/run/hadoop-hdfs /var/log/hadoop-hdfs
-       chown hdfs:hadoop /var/lib/hadoop-hdfs/ /var/lib/hadoop-hdfs/cache
-       chmod 0755 /var/lib/hadoop-hdfs
-       chmod 1777 /var/lib/hadoop-hdfs/cache
-       chmod 1777 /usr/lib/hadoop/logs
-    ;;
-
-    abort-upgrade|abort-remove|abort-deconfigure)
-    ;;
-
-    *)
-        echo "postinst called with unknown argument \`$1'" >&2
-        exit 1
-    ;;
-esac
+[Unit]
+Documentation=https://hadoop.apache.org/
+Description=Hadoop NameNode
+Before=multi-user.target
+Before=graphical.target
+After=remote-fs.target
 
-#DEBHELPER#
+[Service]
+User=hdfs
+Group=hdfs
+Type=forking
+Restart=no
+TimeoutSec=5min
+IgnoreSIGPIPE=no
+KillMode=process
+RemainAfterExit=no
+SuccessExitStatus=5 6
+ExecStart=/usr/bin/hdfs --config /etc/hadoop/conf --daemon start namenode
+ExecStop=/usr/bin/hdfs --config /etc/hadoop/conf --daemon stop namenode
diff --git a/bigtop-packages/src/deb/hadoop/hadoop-hdfs.postinst 
b/bigtop-packages/src/common/hadoop/hadoop-hdfs-secondarynamenode.service
similarity index 54%
copy from bigtop-packages/src/deb/hadoop/hadoop-hdfs.postinst
copy to bigtop-packages/src/common/hadoop/hadoop-hdfs-secondarynamenode.service
index 2d972675d..6ad278d2c 100644
--- a/bigtop-packages/src/deb/hadoop/hadoop-hdfs.postinst
+++ b/bigtop-packages/src/common/hadoop/hadoop-hdfs-secondarynamenode.service
@@ -1,5 +1,3 @@
-#!/bin/bash
-#
 # 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.
@@ -15,28 +13,22 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# postinst script for hadoop
-
-set -e
-
-case "$1" in
-    configure)
-       mkdir -p /var/log/hadoop-hdfs /var/run/hadoop-hdfs 
/var/lib/hadoop-hdfs/cache /usr/lib/hadoop/logs || :
-       chgrp -R hadoop /var/log/hadoop-hdfs /var/run/hadoop-hdfs
-       chmod g+w /var/run/hadoop-hdfs /var/log/hadoop-hdfs
-       chown hdfs:hadoop /var/lib/hadoop-hdfs/ /var/lib/hadoop-hdfs/cache
-       chmod 0755 /var/lib/hadoop-hdfs
-       chmod 1777 /var/lib/hadoop-hdfs/cache
-       chmod 1777 /usr/lib/hadoop/logs
-    ;;
-
-    abort-upgrade|abort-remove|abort-deconfigure)
-    ;;
-
-    *)
-        echo "postinst called with unknown argument \`$1'" >&2
-        exit 1
-    ;;
-esac
+[Unit]
+Documentation=https://hadoop.apache.org/
+Description=Hadoop Secondary NameNode
+Before=multi-user.target
+Before=graphical.target
+After=remote-fs.target
 
-#DEBHELPER#
+[Service]
+User=hdfs
+Group=hdfs
+Type=forking
+Restart=no
+TimeoutSec=5min
+IgnoreSIGPIPE=no
+KillMode=process
+RemainAfterExit=no
+SuccessExitStatus=5 6
+ExecStart=/usr/bin/hdfs --config /etc/hadoop/conf --daemon start 
secondarynamenode
+ExecStop=/usr/bin/hdfs --config /etc/hadoop/conf --daemon stop 
secondarynamenode
diff --git a/bigtop-packages/src/deb/hadoop/hadoop-hdfs.postinst 
b/bigtop-packages/src/common/hadoop/hadoop-hdfs-zkfc.service
similarity index 54%
copy from bigtop-packages/src/deb/hadoop/hadoop-hdfs.postinst
copy to bigtop-packages/src/common/hadoop/hadoop-hdfs-zkfc.service
index 2d972675d..4b10cdc3d 100644
--- a/bigtop-packages/src/deb/hadoop/hadoop-hdfs.postinst
+++ b/bigtop-packages/src/common/hadoop/hadoop-hdfs-zkfc.service
@@ -1,5 +1,3 @@
-#!/bin/bash
-#
 # 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.
@@ -15,28 +13,22 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# postinst script for hadoop
-
-set -e
-
-case "$1" in
-    configure)
-       mkdir -p /var/log/hadoop-hdfs /var/run/hadoop-hdfs 
/var/lib/hadoop-hdfs/cache /usr/lib/hadoop/logs || :
-       chgrp -R hadoop /var/log/hadoop-hdfs /var/run/hadoop-hdfs
-       chmod g+w /var/run/hadoop-hdfs /var/log/hadoop-hdfs
-       chown hdfs:hadoop /var/lib/hadoop-hdfs/ /var/lib/hadoop-hdfs/cache
-       chmod 0755 /var/lib/hadoop-hdfs
-       chmod 1777 /var/lib/hadoop-hdfs/cache
-       chmod 1777 /usr/lib/hadoop/logs
-    ;;
-
-    abort-upgrade|abort-remove|abort-deconfigure)
-    ;;
-
-    *)
-        echo "postinst called with unknown argument \`$1'" >&2
-        exit 1
-    ;;
-esac
+[Unit]
+Documentation=https://hadoop.apache.org/
+Description=Hadoop ZKFC
+Before=multi-user.target
+Before=graphical.target
+After=remote-fs.target
 
-#DEBHELPER#
+[Service]
+User=hdfs
+Group=hdfs
+Type=forking
+Restart=no
+TimeoutSec=5min
+IgnoreSIGPIPE=no
+KillMode=process
+RemainAfterExit=no
+SuccessExitStatus=5 6
+ExecStart=/usr/bin/hdfs --config /etc/hadoop/conf --daemon start zkfc
+ExecStop=/usr/bin/hdfs --config /etc/hadoop/conf --daemon stop zkfc
diff --git a/bigtop-packages/src/deb/hadoop/hadoop-hdfs.postinst 
b/bigtop-packages/src/common/hadoop/hadoop-hdfs.tmpfile
similarity index 54%
copy from bigtop-packages/src/deb/hadoop/hadoop-hdfs.postinst
copy to bigtop-packages/src/common/hadoop/hadoop-hdfs.tmpfile
index 2d972675d..af7a48dbf 100644
--- a/bigtop-packages/src/deb/hadoop/hadoop-hdfs.postinst
+++ b/bigtop-packages/src/common/hadoop/hadoop-hdfs.tmpfile
@@ -1,5 +1,3 @@
-#!/bin/bash
-#
 # 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.
@@ -15,28 +13,4 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# postinst script for hadoop
-
-set -e
-
-case "$1" in
-    configure)
-       mkdir -p /var/log/hadoop-hdfs /var/run/hadoop-hdfs 
/var/lib/hadoop-hdfs/cache /usr/lib/hadoop/logs || :
-       chgrp -R hadoop /var/log/hadoop-hdfs /var/run/hadoop-hdfs
-       chmod g+w /var/run/hadoop-hdfs /var/log/hadoop-hdfs
-       chown hdfs:hadoop /var/lib/hadoop-hdfs/ /var/lib/hadoop-hdfs/cache
-       chmod 0755 /var/lib/hadoop-hdfs
-       chmod 1777 /var/lib/hadoop-hdfs/cache
-       chmod 1777 /usr/lib/hadoop/logs
-    ;;
-
-    abort-upgrade|abort-remove|abort-deconfigure)
-    ;;
-
-    *)
-        echo "postinst called with unknown argument \`$1'" >&2
-        exit 1
-    ;;
-esac
-
-#DEBHELPER#
+d /run/hadoop-hdfs 0755 hdfs hadoop -
diff --git a/bigtop-packages/src/common/hadoop/install_hadoop.sh 
b/bigtop-packages/src/common/hadoop/install_hadoop.sh
index 661b23b47..e4b4c0de2 100755
--- a/bigtop-packages/src/common/hadoop/install_hadoop.sh
+++ b/bigtop-packages/src/common/hadoop/install_hadoop.sh
@@ -181,7 +181,7 @@ export PATH="/sbin/:$PATH"
 # Make bin wrappers
 mkdir -p $PREFIX/$BIN_DIR
 
-for component in $PREFIX/$HADOOP_DIR/bin/hadoop $PREFIX/$HDFS_DIR/bin/hdfs ; do
+for component in $PREFIX/$HADOOP_DIR/bin/hadoop ; do
   wrapper=$PREFIX/$BIN_DIR/${component#*/bin/}
   cat > $wrapper <<EOF
 #!/bin/bash
@@ -235,6 +235,27 @@ exec ${component#${PREFIX}} "\$@"
 EOF
 chmod 755 $wrapper
 
+
+#hdfs
+component=$PREFIX/$HDFS_DIR/bin/hdfs
+wrapper=$PREFIX/$BIN_DIR/${component#*/bin/}
+cat > $wrapper <<EOF
+#!/bin/bash
+
+# Autodetect JAVA_HOME if not defined
+. /usr/lib/bigtop-utils/bigtop-detect-javahome
+
+export HADOOP_IDENT_STRING=\${HADOOP_IDENT_STRING:-hdfs}
+export HADOOP_PID_DIR=\${HADOOP_PID_DIR:-/run/hadoop-hdfs}
+export HADOOP_LOG_DIR=\${HADOOP_LOG_DIR:-/var/log/hadoop-hdfs}
+export HADOOP_CONF_DIR=\${HADOOP_CONF_DIR:-/etc/hadoop/conf}
+
+export HADOOP_LIBEXEC_DIR=/$HADOOP_DIR/libexec
+
+exec ${component#${PREFIX}} "\$@"
+EOF
+chmod 755 $wrapper
+
 #libexec
 install -d -m 0755 $PREFIX/$HADOOP_DIR/libexec
 cp -r ${BUILD_DIR}/libexec/* $PREFIX/$HADOOP_DIR/libexec/
@@ -452,7 +473,8 @@ ln -s $NP_ETC_HADOOP/conf $PREFIX/$YARN_DIR/etc/hadoop
 install -d -m 0755 ${PREFIX}/${VAR_HDFS}
 install -d -m 0755 ${PREFIX}/${VAR_YARN}
 install -d -m 0755 ${PREFIX}/${VAR_MAPREDUCE}
-install -d -m 0755 $PREFIX/var/{log,run}/hadoop-hdfs
+install -d -m 0755 $PREFIX/var/log/hadoop-hdfs
+install -d -m 0755 $PREFIX/run/hadoop-hdfs
 install -d -m 0755 $PREFIX/var/log/hadoop-yarn
 install -d -m 0755 $PREFIX/run/hadoop-yarn
 install -d -m 0755 $PREFIX/var/log/hadoop-mapreduce
diff --git a/bigtop-packages/src/deb/hadoop/hadoop-hdfs.install 
b/bigtop-packages/src/deb/hadoop/hadoop-hdfs.install
index 1851ea933..4d82355df 100644
--- a/bigtop-packages/src/deb/hadoop/hadoop-hdfs.install
+++ b/bigtop-packages/src/deb/hadoop/hadoop-hdfs.install
@@ -8,4 +8,4 @@
 /usr/bin/hdfs
 /var/lib/hadoop-hdfs
 /var/log/hadoop-hdfs
-/var/run/hadoop-hdfs
+/run/hadoop-hdfs
diff --git a/bigtop-packages/src/deb/hadoop/hadoop-hdfs.postinst 
b/bigtop-packages/src/deb/hadoop/hadoop-hdfs.postinst
index 2d972675d..eb87290ec 100644
--- a/bigtop-packages/src/deb/hadoop/hadoop-hdfs.postinst
+++ b/bigtop-packages/src/deb/hadoop/hadoop-hdfs.postinst
@@ -21,9 +21,9 @@ set -e
 
 case "$1" in
     configure)
-       mkdir -p /var/log/hadoop-hdfs /var/run/hadoop-hdfs 
/var/lib/hadoop-hdfs/cache /usr/lib/hadoop/logs || :
-       chgrp -R hadoop /var/log/hadoop-hdfs /var/run/hadoop-hdfs
-       chmod g+w /var/run/hadoop-hdfs /var/log/hadoop-hdfs
+       mkdir -p /var/log/hadoop-hdfs /run/hadoop-hdfs 
/var/lib/hadoop-hdfs/cache /usr/lib/hadoop/logs || :
+       chgrp -R hadoop /var/log/hadoop-hdfs /run/hadoop-hdfs
+       chmod g+w /run/hadoop-hdfs /var/log/hadoop-hdfs
        chown hdfs:hadoop /var/lib/hadoop-hdfs/ /var/lib/hadoop-hdfs/cache
        chmod 0755 /var/lib/hadoop-hdfs
        chmod 1777 /var/lib/hadoop-hdfs/cache
diff --git a/bigtop-packages/src/deb/hadoop/rules 
b/bigtop-packages/src/deb/hadoop/rules
index 70b47241c..fe0ba5ec8 100755
--- a/bigtop-packages/src/deb/hadoop/rules
+++ b/bigtop-packages/src/deb/hadoop/rules
@@ -71,7 +71,6 @@ override_dh_auto_install:
        cp debian/hadoop-fuse.default debian/tmp/etc/default/hadoop-fuse
        mkdir -p debian/tmp/etc/security/limits.d
        cp debian/hdfs.conf debian/yarn.conf debian/mapreduce.conf 
debian/tmp/etc/security/limits.d
-       cp debian/hadoop-mapreduce-historyserver.service .
 
 override_dh_install: $(hadoop_svcs)
        dh_install
diff --git a/bigtop-packages/src/rpm/hadoop/SPECS/hadoop.spec 
b/bigtop-packages/src/rpm/hadoop/SPECS/hadoop.spec
index 521ef5f45..4b01272a0 100644
--- a/bigtop-packages/src/rpm/hadoop/SPECS/hadoop.spec
+++ b/bigtop-packages/src/rpm/hadoop/SPECS/hadoop.spec
@@ -55,7 +55,7 @@
 %define np_var_log_kms /var/log/%{hadoop_name}-kms
 %define np_var_log_mapreduce /var/log/%{hadoop_name}-mapreduce
 %define np_run_yarn /run/%{hadoop_name}-yarn
-%define np_var_run_hdfs /var/run/%{hadoop_name}-hdfs
+%define np_run_hdfs /run/%{hadoop_name}-hdfs
 %define np_var_run_httpfs /var/run/%{hadoop_name}-httpfs
 %define np_var_run_kms /var/run/%{hadoop_name}-kms
 %define np_var_run_mapreduce /var/run/%{hadoop_name}-mapreduce
@@ -184,6 +184,13 @@ Source35: hadoop-yarn-router.service
 Source36: hadoop-yarn-proxyserver.service
 Source37: hadoop-yarn-timelineserver.service
 Source38: hadoop-yarn.tmpfile
+Source39: hadoop-hdfs-namenode.service
+Source40: hadoop-hdfs-datanode.service
+Source41: hadoop-hdfs-secondarynamenode.service
+Source42: hadoop-hdfs-journalnode.service
+Source43: hadoop-hdfs-zkfc.service
+Source44: hadoop-hdfs-dfsrouter.service
+Source45: hadoop-hdfs.tmpfile
 
 #BIGTOP_PATCH_FILES
 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id} -u -n)
@@ -601,7 +608,10 @@ do
        chmod 644 $RPM_BUILD_ROOT/%{etc_default}/%{hadoop_name}-${service}
 done
 
+# mapredudce
 %__install -D -m 0644 %{SOURCE32} 
$RPM_BUILD_ROOT/%{_unitdir}/hadoop-mapreduce-historyserver.service
+
+# yarn
 %__install -D -m 0644 %{SOURCE38} 
$RPM_BUILD_ROOT/%{_tmpfilesdir}/hadoop-yarn.conf
 %__install -D -m 0644 %{SOURCE33} 
$RPM_BUILD_ROOT/%{_unitdir}/hadoop-yarn-resourcemanager.service
 %__install -D -m 0644 %{SOURCE34} 
$RPM_BUILD_ROOT/%{_unitdir}/hadoop-yarn-nodemanager.service
@@ -609,6 +619,15 @@ done
 %__install -D -m 0644 %{SOURCE36} 
$RPM_BUILD_ROOT/%{_unitdir}/hadoop-yarn-proxyserver.service
 %__install -D -m 0644 %{SOURCE37} 
$RPM_BUILD_ROOT/%{_unitdir}/hadoop-yarn-timelineserver.service
 
+# hdfs
+%__install -D -m 0644 %{SOURCE39} 
$RPM_BUILD_ROOT/%{_unitdir}/hadoop-hdfs-namenode.service
+%__install -D -m 0644 %{SOURCE40} 
$RPM_BUILD_ROOT/%{_unitdir}/hadoop-hdfs-datanode.service
+%__install -D -m 0644 %{SOURCE41} 
$RPM_BUILD_ROOT/%{_unitdir}/hadoop-hdfs-secondarynamenode.service
+%__install -D -m 0644 %{SOURCE42} 
$RPM_BUILD_ROOT/%{_unitdir}/hadoop-hdfs-journalnode.service
+%__install -D -m 0644 %{SOURCE43} 
$RPM_BUILD_ROOT/%{_unitdir}/hadoop-hdfs-zkfc.service
+%__install -D -m 0644 %{SOURCE44} 
$RPM_BUILD_ROOT/%{_unitdir}/hadoop-hdfs-dfsrouter.service
+%__install -D -m 0644 %{SOURCE45} 
$RPM_BUILD_ROOT/%{_tmpfilesdir}/hadoop-hdfs.conf
+
 # Install security limits
 %__install -d -m 0755 $RPM_BUILD_ROOT/etc/security/limits.d
 %__install -m 0644 %{SOURCE8} $RPM_BUILD_ROOT/etc/security/limits.d/hdfs.conf
@@ -630,12 +649,12 @@ done
 %__install -d -m 0755 $RPM_BUILD_ROOT/%{np_var_log_httpfs}
 %__install -d -m 0755 $RPM_BUILD_ROOT/%{np_var_log_kms}
 # /var/run/*
-%__install -d -m 0755 $RPM_BUILD_ROOT/%{np_var_run_hdfs}
 %__install -d -m 0755 $RPM_BUILD_ROOT/%{np_var_run_mapreduce}
 %__install -d -m 0755 $RPM_BUILD_ROOT/%{np_var_run_httpfs}
 %__install -d -m 0755 $RPM_BUILD_ROOT/%{np_var_run_kms}
 # /run/*
 %__install -d -m 0755 $RPM_BUILD_ROOT/%{np_run_yarn}
+%__install -d -m 0755 $RPM_BUILD_ROOT/%{np_run_hdfs}
 
 %__install -d -m 1777 $RPM_BUILD_ROOT/%{usr_lib_hadoop}/logs
 
@@ -719,10 +738,11 @@ fi
 %defattr(-,root,root)
 %config(noreplace) %{etc_hadoop}/conf.empty/hdfs-site.xml
 %config(noreplace) /etc/security/limits.d/hdfs.conf
+%config(noreplace) %{_tmpfilesdir}/hadoop-hdfs.conf
 %{usr_lib_hdfs}
 %{usr_lib_hadoop}/libexec/hdfs-config.sh
 %{bin_dir}/hdfs
-%attr(0775,hdfs,hadoop) %{np_var_run_hdfs}
+%attr(0775,hdfs,hadoop) %{np_run_hdfs}
 %attr(0775,hdfs,hadoop) %{np_var_log_hdfs}
 %attr(0755,hdfs,hadoop) %{var_lib_hdfs}
 %attr(1777,hdfs,hadoop) %{var_lib_hdfs}/cache
@@ -828,12 +848,6 @@ if [ $1 -ge 1 ]; then \
   service %{hadoop_name}-%1 condrestart >/dev/null 2>&1 \
 fi
 
-%service_macro hdfs-namenode
-%service_macro hdfs-secondarynamenode
-%service_macro hdfs-zkfc
-%service_macro hdfs-journalnode
-%service_macro hdfs-datanode
-%service_macro hdfs-dfsrouter
 
 # Systemd unit file management RPMs
 %define systemd_macro() \
@@ -859,6 +873,12 @@ fi
 %systemd_macro yarn-proxyserver
 %systemd_macro yarn-timelineserver
 %systemd_macro yarn-router
+%systemd_macro hdfs-namenode
+%systemd_macro hdfs-secondarynamenode
+%systemd_macro hdfs-zkfc
+%systemd_macro hdfs-journalnode
+%systemd_macro hdfs-datanode
+%systemd_macro hdfs-dfsrouter
 
 # Pseudo-distributed Hadoop installation
 %post conf-pseudo

Reply via email to