Return-Path: X-Original-To: apmail-tomcat-dev-archive@www.apache.org Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2A05010177 for ; Sun, 16 Feb 2014 13:16:49 +0000 (UTC) Received: (qmail 70358 invoked by uid 500); 16 Feb 2014 13:16:46 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 69986 invoked by uid 500); 16 Feb 2014 13:16:45 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 69101 invoked by uid 99); 16 Feb 2014 13:16:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 16 Feb 2014 13:16:41 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.115] (HELO eir.zones.apache.org) (140.211.11.115) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 16 Feb 2014 13:16:38 +0000 Received: by eir.zones.apache.org (Postfix, from userid 80) id 82D4B1C87D; Sun, 16 Feb 2014 13:16:17 +0000 (UTC) From: bugzilla@apache.org To: dev@tomcat.apache.org Subject: [Bug 56143] New: Allow "service.bat install" to be used in an non-UAC cmd.exe session Date: Sun, 16 Feb 2014 13:16:15 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Tomcat 7 X-Bugzilla-Component: Integration X-Bugzilla-Version: 7.0.50 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: knst.kolinko@gmail.com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: dev@tomcat.apache.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://issues.apache.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org https://issues.apache.org/bugzilla/show_bug.cgi?id=56143 Bug ID: 56143 Summary: Allow "service.bat install" to be used in an non-UAC cmd.exe session Product: Tomcat 7 Version: 7.0.50 Hardware: PC Status: NEW Severity: enhancement Priority: P2 Component: Integration Assignee: dev@tomcat.apache.org Reporter: knst.kolinko@gmail.com If you use a Microsoft Windows OS that has UAC and use service.bat script to install Tomcat as a service, you have to first launch command console (cmd.exe) in elevated privileges mode ("Run as administrator") and then call "service.bat install" from there. This requirement is mentioned in Tomcat documentation: http://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html#Installing_services [quote] NOTE: On Windows Vista or any other operating system with User Account Control (UAC) you must either disable UAC or right-click on cmd.exe and select "Run as administrator" in order to run this script. If UAC is enabled being logged on with an Administrator account is not sufficient. [/quote] If you forget to launch cmd.exe in that mode and just run "service.bat install", with the current Tomcat versions (6.0.39, 7.0.50, 8.0.3) you will be prompted 3 times by UAC [3], but the service will be installed incorrectly. With r1565781 / r1567742 (7.0.52) this was improved and you will be prompted by UAC only once, but still the service will be installed incorrectly. The cause for this behaviour is that install command in service.bat script uses environment variables (such as PR_CLASSPATH) to pass parameters to service installer (prunsrv).[1] Apparently, when a child application is launched with elevated privileges it does not inherit environment variables from its parent. [2] The consequence is that a number of crucial settings in the installed service will be blank. For example, its classpath and its log path will be blank. As a result, an attempt to launch such service will fail shortly and silently, as Tomcat bootstrap classes are not found and logging is not configured either. (There will be some logs in %SystemRoot%\system32\LogFiles\Apache though). A workaround is to fix such configuration by using service configuration application (tomcat7w.exe) to configure missing options. I hope that this can be solved by changing service.bat so that all necessary options are passed as command-line arguments instead of variables. For reference: [1] Apache Commons Daemon documentation http://commons.apache.org/proper/commons-daemon/procrun.html [2] "Re: r1567742" thread on dev mailing list http://tomcat.markmail.org/thread/tjmwxc5vb5ut4zuq [3] Bug 56079 https://issues.apache.org/bugzilla/show_bug.cgi?id=56079#c6 -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org