You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@crail.apache.org by pe...@apache.org on 2018/06/21 09:31:03 UTC

incubator-crail git commit: Scripts: fix log/pid file for multiple datanodes

Repository: incubator-crail
Updated Branches:
  refs/heads/master f166a0807 -> c6ccda5f4


Scripts: fix log/pid file for multiple datanodes

Fix using the same filename when starting multiple storage
tiers on the same node. Append arguments from slave file
to make path unique.

https://issues.apache.org/jira/projects/CRAIL/issues/CRAIL-29

Signed-off-by: Jonas Pfefferle <pe...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-crail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-crail/commit/c6ccda5f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-crail/tree/c6ccda5f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-crail/diff/c6ccda5f

Branch: refs/heads/master
Commit: c6ccda5f442b8d65ee7f15bd56fb8e0b8388d31d
Parents: f166a08
Author: Jonas Pfefferle <pe...@apache.org>
Authored: Wed Jun 20 15:45:47 2018 +0200
Committer: Jonas Pfefferle <pe...@apache.org>
Committed: Thu Jun 21 11:30:07 2018 +0200

----------------------------------------------------------------------
 libexec/crail-daemon.sh | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-crail/blob/c6ccda5f/libexec/crail-daemon.sh
----------------------------------------------------------------------
diff --git a/libexec/crail-daemon.sh b/libexec/crail-daemon.sh
index 16bea7f..9fea6cb 100755
--- a/libexec/crail-daemon.sh
+++ b/libexec/crail-daemon.sh
@@ -15,6 +15,10 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+function trim() {
+	s="$@"
+	echo ${s//[[:blank:]]/}
+}
 
 usage="Usage: crail-daemon.sh [--config <conf-dir>] [--hosts hostlistfile] [--script script] (start|stop) <hadoop-command> <args...>"
 
@@ -92,13 +96,14 @@ if [ "$HADOOP_PID_DIR" = "" ]; then
   HADOOP_PID_DIR=/tmp
 fi
 
+ARGS=$(trim "$@")
 # some variables
-export HADOOP_LOGFILE=crail-$HADOOP_IDENT_STRING-$command-$HOSTNAME.log
+export HADOOP_LOGFILE=crail-$HADOOP_IDENT_STRING-$command-$ARGS-$HOSTNAME.log
 export HADOOP_ROOT_LOGGER=${HADOOP_ROOT_LOGGER:-"INFO,RFA"}
 export HADOOP_SECURITY_LOGGER=${HADOOP_SECURITY_LOGGER:-"INFO,RFAS"}
 export HDFS_AUDIT_LOGGER=${HDFS_AUDIT_LOGGER:-"INFO,NullAppender"}
-log=$HADOOP_LOG_DIR/crail-$HADOOP_IDENT_STRING-$command-$HOSTNAME.out
-pid=$HADOOP_PID_DIR/crail-$HADOOP_IDENT_STRING-$command.pid
+log=$HADOOP_LOG_DIR/crail-$HADOOP_IDENT_STRING-$command-$ARGS-$HOSTNAME.out
+pid=$HADOOP_PID_DIR/crail-$HADOOP_IDENT_STRING-$command-$ARGS.pid
 HADOOP_STOP_TIMEOUT=${HADOOP_STOP_TIMEOUT:-5}
 
 # Set default scheduling priority