eyanghwx commented on a change in pull request #894: HDDS-1635. Maintain docker 
entrypoint and envtoconf inside ozone project
URL: https://github.com/apache/hadoop/pull/894#discussion_r289943713
 
 

 ##########
 File path: hadoop-ozone/dist/src/main/dockerbin/entrypoint.sh
 ##########
 @@ -0,0 +1,138 @@
+#!/usr/bin/env 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.  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.
+##
+set -e
+
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+
+if [ -n "$SLEEP_SECONDS" ]; then
+   echo "Sleeping for $SLEEP_SECONDS seconds"
+   sleep $SLEEP_SECONDS
 
 Review comment:
   You might need pwd -P to resolve symlinks.  I don't recommend to use script 
location to make decision of where binaries are supposed to be because someone 
else can make newbie mistake and refactor your script to invalid the original 
coding intend.  See this blog to explain [the right way to get the directory of 
a bash 
script](https://www.ostricher.com/2014/10/the-right-way-to-get-the-directory-of-a-bash-script/).
  This is the reason that I used OZONE_HOME as base reference frequently.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to