Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Done
-
None
-
None
Description
Currently the ozone shell, $ozone sh, command uses the hard-coded value for the shell logs, ozone-shell.log. This Jira is to allow users to override the log name by letting them set user defined log file names through an appended environment variable.
The first time the ozone sh is run it creates a log file named ozone-shell.log in the $OZONE_LOG_DIR. What is observed is that when switching the shell user, the new user cannot invoke the ozone sh command successfully. Instead the user receives a trace of errors indicating the user does not have permission to access the ozone-shell.log file:
anotheruser cannot access file set by user hadoop that initially invoked the ozone sh
[anotheruser@d8e5ed3fbc4a hadoop]$ ozone sh log4j:ERROR setFile(null,true) call failed. java.io.FileNotFoundException: /var/log/hadoop/ozone-shell.log (Permission denied) at java.base/java.io.FileOutputStream.open0(Native Method) at java.base/java.io.FileOutputStream.open(FileOutputStream.java:298) at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:237) at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:158) at org.apache.log4j.FileAppender.setFile(FileAppender.java:294)
$ ls -alt /var/log/hadoop/ozone-shell.log -rw-r--r-- 1 hadoop hadoop 0 Aug 19 18:37 /var/log/hadoop/ozone-shell.log
Attachments
Issue Links
- relates to
-
HDDS-7421 Respect OZONE_LOGLEVEL and OZONE_ROOT_LOGGER for CLI commands
- Resolved
- links to