Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
When I run the command
sudo su hcat -c "/usr/lib/hcatalog/sbin/webhcat_server.sh start"
from a directory where hcat user doesn't have permission to write it fails to start throwing the following error in the logfile:
log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: ./templeton.log (Permission denied)
at java.io.FileOutputStream.openAppend(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:192)
at java.io.FileOutputStream.<init>(FileOutputStream.java:116)
at org.apache.log4j.FileAppender.setFile(FileAppender.java:290)
at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:164)
at org.apache.log4j.DailyRollingFileAppender.activateOptions(DailyRollingFileAppender.java:216)
at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:257)
............
The templeton.log should have been written to the directory specified by $WEBHCAT_LOG_DIR
The problem lies in the script webhcat_server.sh, it sets webhcat.log.dir.
export HADOOP_OPTS="-Dwebhcat.log.dir=$WEBHCAT_LOG_DIR -Dlog4j.configuration=$WEBHCAT_LOG4J"
But the default log4j configuration is using templeton.log.dir