Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#21268 - [tomcat] access log

Attached to Project: Arch Linux
Opened by Viczai Gabor (gviczai) - Friday, 15 October 2010, 08:48 GMT
Last edited by Allan McRae (Allan) - Saturday, 28 April 2012, 15:51 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Guillaume ALAUX (galaux)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

- After turning on the logging in $CATALINA_HOME/conf/server.xml by uncommenting the appropiate "valve" section, nothing happens. No error logs in catalina.log either.
This is because the logs directory has the ownership root:root with flags rwxr-xr-x and Catalina runs as the tomcat user, thus the process has no write permission on the directory.

Additional info:
* package version(s)
* config and/or log files etc.

- Tomcat 5.5.31

Steps to reproduce:

- See description.

Workaround/resolution:

- Either set the log directory in the "valve" section to a writable one, or change the ownership of the default logs dir to root:tomcat and the permissions to rwxrwxr-w.
This task depends upon

Closed by  Allan McRae (Allan)
Saturday, 28 April 2012, 15:51 GMT
Reason for closing:  Fixed
Comment by Viczai Gabor (gviczai) - Friday, 15 October 2010, 08:49 GMT
Of course I meant to write "solution" instead of "resolution". ;)
Comment by Gerardo Exequiel Pozzi (djgera) - Saturday, 16 October 2010, 02:34 GMT
  • Field changed: Attached to Project (Community Packages → Arch Linux)
  • Field changed: Status (Unconfirmed → Assigned)
  • Task assigned to Guillaume ALAUX (galaux)
And mean to put in "Arch Linux" project :P
Comment by Guillaume ALAUX (galaux) - Saturday, 16 October 2010, 09:30 GMT
Hi Viczai,

Which log are we talking of?
- catalina.log?
This one is set in /etc/rc.d/tomcat to /opt/tomcat/logs/catalina.log. Feel free to change it on your box to any other place you like, but here out of the box, tomcat manages to write in it.

- localhost_access_log.$(date).txt ?
This one is set using valve org.apache.catalina.valves.AccessLogValve in server.xml. As you said it needs to be set to a directory on which tomcat has write access. Are you suggesting to chgroup tomcat /opt/tomcat/logs by default so that if user enables access log but keeps the default directory then it would work out of the box?
Comment by Viczai Gabor (gviczai) - Sunday, 24 October 2010, 21:25 GMT
"- localhost_access_log.$(date).txt ?
This one is set using valve org.apache.catalina.valves.AccessLogValve in server.xml. As you said it needs to be set to a directory on which tomcat has write access. Are you suggesting to chgroup tomcat /opt/tomcat/logs by default so that if user enables access log but keeps the default directory then it would work out of the box?"

Exactly. I spent hours googling till I found the problem. The Tomcat documentation says: simply uncomment the valve and it will work. Every article, blog, etc. on the net says the same. I've done that. Nothing. Not even an error log about what is the problem.
If the document says "simply uncomment the valve and it will work", let it be.
Comment by Guillaume ALAUX (galaux) - Monday, 01 November 2010, 16:10 GMT
> If the document says "simply uncomment the valve and it will work", let it be.
Sounds fair! I will do so on the next release. Thanks.
Comment by Fırat Salgür (neurosys) - Saturday, 11 December 2010, 20:05 GMT
Hello,

Given that a tomcat user and group is created, I don't see any
issues starting tomcat as its own user. So I modified the rc script,
and assigned tomcat base (/opt/tomcat) to its user and group.
It seems to resolve the permission issues, and runs tomcat
supposedly more secure. I attach the rc script to the comment.
   tomcat (0.7 KiB)
Comment by Fırat Salgür (neurosys) - Saturday, 11 December 2010, 20:35 GMT
The above one is pretty lame, heh. This one makes use of
jsvc as is suitable.
Comment by Guillaume ALAUX (galaux) - Monday, 13 December 2010, 08:40 GMT
> starting tomcat as its own user
That's the point of the "-user" option of jsvc we already use.

"-user which causes it to switch to another user after the daemon initialization is complete. This allows, for example, running Tomcat as a non privileged user while still being able to use privileged ports. jsvc --help will return the full jsvc usage information"

http://tomcat.apache.org/tomcat-5.5-doc/setup.html#Unix_daemon
Comment by Guillaume ALAUX (galaux) - Friday, 17 June 2011, 16:13 GMT
Will be fixed when tomcat-5.5.33 is out.
Comment by Allan McRae (Allan) - Saturday, 28 April 2012, 15:51 GMT
> pacman -Si tomcat
Repository : extra
Name : tomcat
Version : 5.5.34-1

Assuming fixed...

Loading...