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 AA8FEDD6B for ; Wed, 1 Aug 2012 18:48:15 +0000 (UTC) Received: (qmail 24124 invoked by uid 500); 1 Aug 2012 18:48:12 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 24062 invoked by uid 500); 1 Aug 2012 18:48:12 -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 24051 invoked by uid 99); 1 Aug 2012 18:48:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Aug 2012 18:48:12 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [80.237.132.197] (HELO wp190.webpack.hosteurope.de) (80.237.132.197) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Aug 2012 18:48:05 +0000 Received: from p4fcb58f3.dip.t-dialin.net ([79.203.88.243] helo=[10.1.1.251]); authenticated by wp190.webpack.hosteurope.de running ExIM with esmtpa id 1SwdxQ-0007Im-AR; Wed, 01 Aug 2012 20:47:44 +0200 Message-ID: <50197980.5090101@mayr-stefan.de> Date: Wed, 01 Aug 2012 20:46:24 +0200 From: Stefan Mayr User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: users@tomcat.apache.org Subject: Re: Issue with sudo + init script References: <517F37858E593249B11B9B7B6BA732072ED7B21D@umechphd.easf.csd.disa.mil> In-Reply-To: <517F37858E593249B11B9B7B6BA732072ED7B21D@umechphd.easf.csd.disa.mil> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-bounce-key: webpack.hosteurope.de;stefan@mayr-stefan.de;1343846885;d6ddc06a; Am 01.08.2012 19:10, schrieb Shaw, Ray V CTR (US): > I'm starting up Tomcat 7.0 on RHEL6 with the following init script: > > #!/bin/bash > # > # chkconfig: 235 80 20 > # description: Takes care of starting and stopping Tomcat. > > CATALINA_HOME="/opt/tomcat7" > export JAVA_HOME="/usr/java/jdk6-64/" > > case "$1" in > 'start') > /bin/su tomcat -c "$CATALINA_HOME/bin/startup.sh -security" > ;; > 'stop') > /bin/su tomcat -c $CATALINA_HOME/bin/shutdown.sh > ;; > *) > echo "usage: $0 {start|stop}" > ;; > esac > > If I use sudo -s (or -i) to get a root shell, I can use this script to start and stop Tomcat. > > If I invoke this script directly via sudo, i.e. "sudo /sbin/service tomcat7 stop", stopping Tomcat works. Starting does not; Tomcat gives the usual output to the terminal, creates or touches catalina.out (but writes nothing to it), and then instantly exits. This is a problem, because I need to allow the Web admin to start/stop Tomcat without giving them everything. > > Has anyone seen anything similar to this before? /var/log/secure isn't showing anything out of the ordinary (and obviously, the commands are being run). > Could you post your tomcat output when you try to start it? You should also check differences in your environment variables when using different methods. - Stefan --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org