{"id":332,"date":"2006-04-10T08:42:49","date_gmt":"2006-04-10T14:42:49","guid":{"rendered":"http:\/\/www.mooreds.com\/wordpress\/?p=332"},"modified":"2007-04-23T17:57:30","modified_gmt":"2007-04-23T23:57:30","slug":"jsvc-and-large-log-files","status":"publish","type":"post","link":"https:\/\/www.mooreds.com\/wordpress\/archives\/332","title":{"rendered":"JSVC and large log files"},"content":{"rendered":"<p><a href=\"http:\/\/jakarta.apache.org\/commons\/daemon\/jsvc.html\">jsvc<\/a>, which is used for daemoning <a href=\"http:\/\/tomcat.apache.org\/\">Tomcat<\/a> and other java applications on unix, takes <a href=\"http:\/\/jakarta.apache.org\/commons\/daemon\/jsvc.html#Starting%20jsvc\">filenames for stdout and stderr as arguments<\/a>.  One thing to be aware of is that when the either of these files reach a size of just over 2 gigabytes, jsvc simply fails.  No error message.  If you restart the application, it will note that it can&#8217;t write to the file and proceeds to write to the console.  I saw this behavior using tomcat 5 on fedora core 4 with jsvc 1.0.1 (described <a href=\"http:\/\/www.mooreds.com\/weblog\/archives\/000295.html\">here<\/a>).<\/p>\n<p>I am not sure exactly what the problem is, but when I started tomcat via the normal shell script, it was able to write to that file.  The user that jsvc runs as had no limits on file size:<\/p>\n<pre>-bash-3.00$ ulimit -a\r\ncore file size          (blocks, -c) 0\r\ndata seg size           (kbytes, -d) unlimited\r\nfile size               (blocks, -f) unlimited\r\npending signals                 (-i) 1024\r\nmax locked memory       (kbytes, -l) 32\r\nmax memory size         (kbytes, -m) unlimited\r\nopen files                      (-n) 1024\r\npipe size            (512 bytes, -p) 8\r\nPOSIX message queues     (bytes, -q) 819200\r\nstack size              (kbytes, -s) 10240\r\ncpu time               (seconds, -t) unlimited\r\nmax user processes              (-u) 32764\r\nvirtual memory          (kbytes, -v) unlimited\r\nfile locks                      (-x) unlimited<\/pre>\n<p>Therefore, it might be an issue with jsvc.  Do note that there are <a href=\"http:\/\/cvs.apache.org\/builds\/jakarta-commons\/nightly\/commons-daemon\/\">nightly snapshots of jsvc<\/a>, which might solve the issue.  The solution I found is to use the <code>copytruncate<\/code> option of <a href=\"http:\/\/www.fifi.org\/cgi-bin\/man2html\/usr\/share\/man\/man8\/logrotate.8.gz\">logrotate<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>jsvc, which is used for daemoning Tomcat and other java applications on unix, takes filenames for stdout and stderr as arguments. One thing to be aware of is that when [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,14],"tags":[],"class_list":["post-332","post","type-post","status-publish","format-standard","hentry","category-programming","category-tomcat"],"_links":{"self":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/332","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/comments?post=332"}],"version-history":[{"count":0,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/332\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/media?parent=332"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/categories?post=332"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/tags?post=332"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}