Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tomcat 8 change catalina.out permissions to be readable by all

The catalina.out file is getting created with "-rw-r-----" permissions (i.e 640 permissions). I want to give read permission to "others" too but that is not happening.

Tried setting umask as 022 in setenv.sh and in other places but this did not help.

Also tried touching files manually using the same tomcat user and they are getting created with "-rw-rw-r--" (i.e 664 permissions). So not sure why tomcat is behaving this way.

Also don't want to manually change the permissions using chmod etc as this is a hack and needs to be repeated in case of file deletion.

like image 442
janeshs Avatar asked Feb 24 '17 11:02

janeshs


People also ask

What is Catalina out file in tomcat?

The catalina.out log messages and log files communicate events and conditions that affect Tomcat server's operations. Logs for all identity applications components including OSP and Identity Reporting are also logged to the catalina.out file.

Where is the Catalina out file in tomcat?

This log file exists on the computer hosting the Tomcat server instance. Each server instance contains its own Catalina. out log file. This file is located in the logs directory below the Tomcat root directory.


1 Answers

Solved the problem by adding an environment variable called "UMASK" (all capitals) as follows. This env variable should be set before invoking catalina.sh.

export UMASK="0022"

To give some background, the catalina.sh script looks for UMASK environment variable (Optional). If this variable is not present in the environment, Tomcat uses default UMASK of 0027, else it uses the override value for umask.

like image 127
janeshs Avatar answered Sep 20 '22 21:09

janeshs