Index: bin/hbase-daemon.sh =================================================================== --- bin/hbase-daemon.sh (revisão 130) +++ bin/hbase-daemon.sh (cópia de trabalho) @@ -147,12 +147,25 @@ hbase_rotate_log $loggc echo starting $command, logging to $logout # Add to the command log file vital stats on our environment. + echo "`date` Starting $command on `hostname`" >> $logout echo "`date` Starting $command on `hostname`" >> $loglog + if [ $? -ne 0 ]; then + echo "[ERROR] Failed to write $loglog when starting $command on `hostname`." && exit 1 + fi echo "`ulimit -a`" >> $loglog 2>&1 + if [ $? -ne 0 ]; then + echo "[ERROR] Failed to write $loglog when echo \'ulimit -a\'. " && exit 1 + fi + if [ ! -w $logout ]; then + echo "[ERROR] $logout on `hostname` does not have write permission." && exit 1 + fi nohup nice -n $HBASE_NICENESS "$HBASE_HOME"/bin/hbase \ --config "${HBASE_CONF_DIR}" \ $command "$@" $startStop > "$logout" 2>&1 < /dev/null & echo $! > $pid + if [ $? -ne 0 ]; then + echo "[ERROR] Failed to write $pid with process id." && exit 1 + fi sleep 1; head "$logout" ;; @@ -162,6 +175,9 @@ if kill -0 `cat $pid` > /dev/null 2>&1; then echo -n stopping $command echo "`date` Terminating $command" >> $loglog + if [ $? -ne 0 ]; then + echo "[ERROR] Failed to write $loglog before stopping $command." && exit 1 + fi kill `cat $pid` > /dev/null 2>&1 while kill -0 `cat $pid` > /dev/null 2>&1; do echo -n "."