Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AF39D106AB for ; Thu, 1 Aug 2013 15:56:18 +0000 (UTC) Received: (qmail 45211 invoked by uid 500); 1 Aug 2013 15:56:15 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 45156 invoked by uid 500); 1 Aug 2013 15:56:15 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 45147 invoked by uid 99); 1 Aug 2013 15:56:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Aug 2013 15:56:14 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of cschneiderpublic@gmail.com designates 74.125.82.46 as permitted sender) Received: from [74.125.82.46] (HELO mail-wg0-f46.google.com) (74.125.82.46) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Aug 2013 15:56:09 +0000 Received: by mail-wg0-f46.google.com with SMTP id k13so1820650wgh.25 for ; Thu, 01 Aug 2013 08:55:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=d4tmSxLWN8oDmyfk7+H+3EGPrvWC4jlX7oYak1WTQEY=; b=yKU+4v//pZvDKRj5byHiOsJ0UpH1qJnCnH16e1/GAZx2gcA3Vhj0vJcMWJHdk4y0Jw nrYVFEERbSnOkFYLtg6lFh+ixA6/9JH4LGfpo2da9WH/XnBBCGKexXb8kDDJFLlMMcor rotnV/DxFLVawD9kkwXhJkamF4Ng3dqxlYTpDbdhWw6Fu3ai+e3DP25fcf3fRXvP58zh CuRh0OpLcC44dGwfU5I/gvzxV5gU7zq9iEcVQA3nAVWYajrDa7DkkkIr4e1Qrw/lfQkC KTXZywhn7ApUefttEO8AOphfcDwK7ODFkRFq2USn/NJLlCd+j3NgOZBU+b7WRbKkZTS7 L/Gw== MIME-Version: 1.0 X-Received: by 10.194.249.195 with SMTP id yw3mr1758624wjc.65.1375372549082; Thu, 01 Aug 2013 08:55:49 -0700 (PDT) Received: by 10.194.220.100 with HTTP; Thu, 1 Aug 2013 08:55:49 -0700 (PDT) In-Reply-To: <51F7D27D.4080909@gmail.com> References: <51F7D27D.4080909@gmail.com> Date: Thu, 1 Aug 2013 17:55:49 +0200 Message-ID: Subject: Re: Using the bin/daemon.sh script on ubuntu. From: Christian Schneider To: Tomcat Users List Content-Type: multipart/alternative; boundary=001a11c278b638d5ad04e2e4e027 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c278b638d5ad04e2e4e027 Content-Type: text/plain; charset=ISO-8859-1 Thanks for the great responses. @Ognjen: Yes, currently we also use the setenv.sh (because it will not be touched by an update). The *ln -s* Tipp is not bad. But the problem is, it stores the files in the folder (/opt/tomcat/logs). On our (AWS) installation we have limited space on /opt, therefore we attached an EBS volume to /var/, - otherwise we would get problems with the log files. Now it can grow above some GB. But because the log dirs are defined in the logging.properties (what get shipped and overridden by updates) we put this "hack" into our setenv.sh: sed -i 's/${catalina.base}\/logs/\/var\/log\/tomcat\//g' \/opt\/tomcat\/conf\/logging.properties This will replace the sting *${catalina.base}\/logs* with */var\/log\/tomcat * everytime setenv.sh is executed. Now we will never forget to touch the logging.properties after an update. But i still think it is not that elegant... Best Regards, Christian. 2013/7/30 Ognjen Blagojevic > Christian, > > > On 30.7.2013 11:58, Christian Schneider wrote: > >> But what about: >> * set env. variables (maybe: catalina.sh?, /etc/profiles?) >> > > /etc/profiles is executed when you enter bash shell, so if Tomcat starts > at boot time, it won't be able to access environment variables defined in > /etc/profile. > > I set JAVA_HOME, CATALINA_BASE and CATALINA_HOME environment variables in > /etc/init.d/tomcat (which is a copy of daemon.sh), but I guess there may be > a better place to do that. > > This link [1] recommends to put environment variables in > /etc/default/tomcat, and then to source them from /etc/init.d/tomcat. > > > > * adjust the heap size >> > > Create file $CATALINA_BASE/bin/setenv.sh: > > ---- > export CATALINA_OPTS='-Xms...m -Xmx...m' > ---- > > > > * logging to the right directory (like: /var/log/tomcat/...) >> > > Maybe something like: > > ln -s /var/log/tomcat $CATALINA_BASE/logs > > > > * specifying the User: "tomcat" >> > > User 'tomcat' is already specified in daemon.sh, though you may override > that with $TOMCAT_USER environment variable. > > -Ognjen > > [1] http://unix.stackexchange.com/**questions/44370/how-to-make-** > unix-service-see-environment-**variables > > > ------------------------------**------------------------------**--------- > To unsubscribe, e-mail: users-unsubscribe@tomcat.**apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > > --001a11c278b638d5ad04e2e4e027--