Return-Path: X-Original-To: apmail-commons-user-archive@www.apache.org Delivered-To: apmail-commons-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BD2E417E49 for ; Tue, 11 Nov 2014 15:12:37 +0000 (UTC) Received: (qmail 54580 invoked by uid 500); 11 Nov 2014 15:12:36 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 54448 invoked by uid 500); 11 Nov 2014 15:12:36 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 54436 invoked by uid 99); 11 Nov 2014 15:12:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Nov 2014 15:12:36 +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 garydgregory@gmail.com designates 209.85.216.175 as permitted sender) Received: from [209.85.216.175] (HELO mail-qc0-f175.google.com) (209.85.216.175) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Nov 2014 15:12:10 +0000 Received: by mail-qc0-f175.google.com with SMTP id b13so8696508qcw.6 for ; Tue, 11 Nov 2014 07:12:09 -0800 (PST) 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=7eY/htVRvKCQJ2l3HWZJ2ms4HgjVmTQji60TDVT5fN8=; b=omJ3a/d/glLlpxqmGE/qpgzp38bBig4L94+J5PwsZwFXoxBIX59DlqLlm4ylJtZzA7 Xbx0nHHi0H5xDBDRobXSBEUmosj+DzMosrwDlYBX09h6vbJwzzCS0QNEKeCjsf+b1VCx 62KBzmggT+9v3wSpdUoDFzGVQo58aG4LtsDPORUlxuMVpPg2GfOFyUJH8YQRKc7dNPy9 WBzIU20afVnJhcolUOnXHAbIwc1znDkMGXk9q3r4csdNcZF1tXJnv3UwHHTc26x872Er V6/fixOdYE/GXLdXM2HE1uNFkvMrooV7WJCqG/n1uHJqye56SYyTMtDdChugvZXqf/fU lbEw== MIME-Version: 1.0 X-Received: by 10.224.138.2 with SMTP id y2mr49561910qat.52.1415718729350; Tue, 11 Nov 2014 07:12:09 -0800 (PST) Received: by 10.140.133.196 with HTTP; Tue, 11 Nov 2014 07:12:09 -0800 (PST) In-Reply-To: References: Date: Tue, 11 Nov 2014 10:12:09 -0500 Message-ID: Subject: Re: [daemon] Unable to read tomcat.pid file created by Tomcat process From: Gary Gregory To: Commons Users List Content-Type: multipart/alternative; boundary=047d7b6709c3f70337050796b323 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b6709c3f70337050796b323 Content-Type: text/plain; charset=UTF-8 Oops, sorry, please ignore my previous message. On Tue, Nov 11, 2014 at 10:11 AM, Gary Gregory wrote: > Wrong list. You probably want > https://tomcat.apache.org/lists.html#tomcat-users > > Gary > > On Tue, Nov 11, 2014 at 10:06 AM, Anil Ambati wrote: > >> I was asked to post this question in this forum. >> >> We have a requirement to read the PID file created by the Tomcat server >> process on Windows, but we are not able to using RandomAccessFile or >> FileInputStream because the file seems to be >> locked by the Tomcat process. >> >> Why does the Tomcat server keep the PID file locked, preventing other >> processes to even read the file? Is there a work around or solution for >> this problem? >> >> >> Christopher Schultz wrote this in Tomcat user forum: >> ---------------------------------------------------- >> I took a quick look, and it looks like the PID file is being created >> with a file option FILE_FLAG_DELETE_ON_CLOSE which causes the OS to >> delete the file off the disk when all file handles are closed. So, >> closing the file handle will result in the PID file being deleted. >> >> This option was added because the PID file wasn't being removed if the >> service crashed, which kept the service from restarting (oops). >> >> https://issues.apache.org/jira/browse/DAEMON-183 >> >> It seems like an option to control what happens on startup when the >> PID file already exists would be a good idea. You'll have to ask the >> procrun folks about what the options are. It seems reasonable to be >> able to read the PID file, since not being able to read it makes it >> kind of useless other than as a lock-file (i.e. its contents are >> irrelevant). >> >> >> Regards, >> ------------------------------ >> *Anilkumar Ambati* 4205 S Miami Blvd >> WebSphere Virtual Enterprise Development Durham, 27703-9141 Phone: >> +1-919-254-6152 USA Mobile: +1-919-434-5674 e-mail: >> aambati@us.ibm.com >> ------------------------------ >> "You have no responsibility to live up to what other people think you >> ought to accomplish." -Richard Feynman (1918-1988) >> > > > > -- > E-Mail: garydgregory@gmail.com | ggregory@apache.org > Java Persistence with Hibernate, Second Edition > > JUnit in Action, Second Edition > Spring Batch in Action > Blog: http://garygregory.wordpress.com > Home: http://garygregory.com/ > Tweet! http://twitter.com/GaryGregory > -- E-Mail: garydgregory@gmail.com | ggregory@apache.org Java Persistence with Hibernate, Second Edition JUnit in Action, Second Edition Spring Batch in Action Blog: http://garygregory.wordpress.com Home: http://garygregory.com/ Tweet! http://twitter.com/GaryGregory --047d7b6709c3f70337050796b323--