Summary: | catalina.sh fix in #49728 breaks PID handling again | ||
---|---|---|---|
Product: | Tomcat 6 | Reporter: | Robert Oschwald <roos> |
Component: | Catalina | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | mikevdg, roos |
Priority: | P2 | ||
Version: | unspecified | ||
Target Milestone: | default | ||
Hardware: | PC | ||
OS: | All | ||
Attachments: | Patch to fix existing, empty pid file handling |
Description
Robert Oschwald
2010-10-13 08:06:57 UTC
What is your suggestion how to deal with it? I might think about truncating the stale PID file instead of deleting it. To truncate a file one might redirect empty output to it, as shown in [1], using the "colon" (no-op) command: :>"$CATALINA_PID" [1] http://linuxdemon.blogspot.com/2007/06/how-to-truncate-file-in-unixlinux.html The following also works: true>"$CATALINA_PID" In my opinion, thats not necessary. I will add a patch to this ticket with my workaround to the problem. Basically, when an empty pid file exists, its' just filled by catalina.sh Created attachment 26167 [details]
Patch to fix existing, empty pid file handling
Note: echo $! > "$CATALINA_PID" creates the file if not existent and fills existing files (overwrites existing content)
Thanks for the report and the suggested patch. I applied a different patch that retained the current behavior where the containing dir is writable but better handles (without error messages) the case where it is not. Fixed for 7.0.x and will be included in 7.0.5 onwards. Proposed for 6.0.x. *** Bug 50130 has been marked as a duplicate of this bug. *** Fixed in trunk and will be in 6.0.30 onwards. |