diff --git a/bin/hbase-daemon.sh b/bin/hbase-daemon.sh index ffae30a..fd08b77 100755 --- a/bin/hbase-daemon.sh +++ b/bin/hbase-daemon.sh @@ -147,11 +147,17 @@ case $startStop in echo starting $command, logging to $logout # Add to the command log file vital stats on our environment. echo "`date` Starting $command on `hostname`" >> $loglog + [ $? -eq 0 ] || echo "[ERROR] Failed to write $loglog when starting $command on `hostname`." && exit 1 echo "`ulimit -a`" >> $loglog 2>&1 + [ $? -eq 0 ] || echo "[ERROR] Failed to write $loglog when echo \'ulimit -a\'. " && exit 1 + 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 + [ $? -eq 0 ] || echo "[ERROR] Failed to write $pid with process id." && exit 1 sleep 1; head "$logout" ;; @@ -161,6 +167,7 @@ case $startStop in if kill -0 `cat $pid` > /dev/null 2>&1; then echo -n stopping $command echo "`date` Terminating $command" >> $loglog + [ $? -eq 0 ] || echo "[ERROR] Failed to write $loglog before stopping $command." && exit 1 kill `cat $pid` > /dev/null 2>&1 while kill -0 `cat $pid` > /dev/null 2>&1; do echo -n "."