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 17BE56965 for ; Fri, 29 Jul 2011 21:40:13 +0000 (UTC) Received: (qmail 86867 invoked by uid 500); 29 Jul 2011 21:40:12 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 86630 invoked by uid 500); 29 Jul 2011 21:40:11 -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 86619 invoked by uid 99); 29 Jul 2011 21:40:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Jul 2011 21:40:11 +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; Fri, 29 Jul 2011 21:40:08 +0000 Received: by eir.zones.apache.org (Postfix, from userid 80) id E328548C51; Fri, 29 Jul 2011 21:39:46 +0000 (UTC) From: bugzilla@apache.org To: dev@tomcat.apache.org Subject: DO NOT REPLY [Bug 51587] New: Implement status and uptime commands Date: Fri, 29 Jul 2011 21:39:46 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Tomcat 7 X-Bugzilla-Component: Catalina 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-Changed-Fields: Message-ID: X-Bugzilla-URL: https://issues.apache.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org https://issues.apache.org/bugzilla/show_bug.cgi?id=51587 Bug #: 51587 Summary: Implement status and uptime commands Product: Tomcat 7 Version: unspecified Platform: PC OS/Version: Windows XP Status: NEW Severity: enhancement Priority: P2 Component: Catalina AssignedTo: dev@tomcat.apache.org ReportedBy: knst.kolinko@gmail.com Classification: Unclassified In Tomcat HowTo wiki it is mentioned that it would be nice to have "status" and "uptime" commands in Tomcat. [1] [1] http://wiki.apache.org/tomcat/HowTo#How_do_I_check_whether_Tomcat_is_UP_or_DOWN.3F_There_is_no_status_command My thoughts on implementing it are the following: 1. Create a Listener class "TomcatStatusListener" and add it to server.xml. 2. The class will implement a non-daemon waiting loop, like the one implemented in StandardServer.await. One of issues in StandardServer.await is that it starts listening on a port only after Tomcat startup completes. If it fails to open the port (e.g. another Tomcat instance is running) it shuts down Tomcat, but I think that it happens too late. (*) The listener can start listening on the port earlier. (*) existing workarounds are using CATALINA_PID setting in catalina.sh/setenv.sh and configuring o.a.c.s.EXIT_ON_INIT_FAILURE system property. 3. The control port and shutdown command for the listener can be read from the StandardServer object. After that the await behaviour of the server can be disabled by programmatically changing StandardServer.port to a negative value. I think that there is some undocumented code for the value of -2 there already, or we can add some additional explicit flag to the StandardServer object. Note, that when shutting down Tomcat the port number is being read from port attribute on the Server element. The code wouldn't look for the listener implementations, so there would not be much sense in specifying a different port on the Listener element. 4. Implement additional commands, "status" and "uptime" in the listener. The "status" command can print the value of StandardServer.getStateName(). It might be done that the output of the "status" command were enhanceable. E.g. some structured data (status, uptime, start date) - compare with comment 7 in bug 49395. It is up to the other side of control port connection to interpret the value and print a more human-friendly message. E.g.: Tomcat Status: STARTED, 13:0:14, 2011-07-30T11:51 Running. Started on July 20, 2011 11:51. Uptime 13 day(s) 0 hour(s) 14 minute(s). 5. If shutdown is implemented by the listener, it would be possible to initiate shutdown before Tomcat fully starts up. 6. If there is no such listener in server.xml, the behaviour remains the same as earlier with await loop being run by StandardServer. -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- 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