Date: Tue, 06 Sep 2011 12:35:34 -0700 From: Doug Barton <dougb@FreeBSD.org> To: Devin Teske <devin.teske@fisglobal.com> Cc: freebsd-rc@freebsd.org, ale@FreeBSD.org Subject: Re: www/tomcat7 bug in rc.d startup script when clear_tmp_enable="YES" Message-ID: <4E667606.7010300@FreeBSD.org> In-Reply-To: <038001cc6ccb$32226ea0$96674be0$@fisglobal.com> References: <038001cc6ccb$32226ea0$96674be0$@fisglobal.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Since this is a port you are infinitely more likely to get attention to
the issue if you cc the maintainer.
The right answer here is that:
# REQUIRE: NETWORKING SERVERS
# BEFORE: DAEMON
should be
REQUIRE: LOGIN
since this service runs as an unprivileged user. That will also solve
the clear_tmp problem.
Doug
On 09/06/2011 12:28, Devin Teske wrote:
> Hi List,
>
> A bit short on time here and can't file a PR just this minute, but wanted to
> share a buggette that we've discovered in the www/tomcat7 port (currently at
> version 7.0.20 as of last week, but bug dates back months as far back as version
> 7.0.14 and perhaps further).
>
> ___ Bug description: ___
>
> If one puts the following two lines into one's rc.conf(5) configuration:
>
> tomcat7_enable="YES"
> clear_tmp_enable="YES"
>
> What happens is that tomcat7 is fired up and creates his
>
> /tmp/hsperfdata_{user}
>
> directory, but then later the clear_tmp script is fired and blows away items
> recently created by tomcat.
>
> The end-result is that after booting the system, one can execute:
>
> service tomcat7 status
>
> and get the false response:
>
> tomcat7 is not running
>
> Meanwhile, one can execute:
>
> ps auxwww | sh -c 'head -1; grep java'
>
> and clearly see that tomcat *is* running. Indeed, one can even execute:
>
> cat /var/run/tomcat7.pid
>
> and indeed, this is the correct pid.
>
> ___ Root-cause description: ___
>
> The problem is truly that the tomcat7 rc.d script uses the jps command to
> determine that the appropriate java process is running and that jps relies on
> data in the java.io.tmpdir directory (/tmp) which was.... (wait for it) ...
> whacked by clear_tmp moments after firing up tomcat.
>
> ___ Solution description: ___
>
> Apply the following patch to /usr/local/etc/rc.d/tomcat7:
>
> ========== BEGIN PATCH EXCERPT ==========
> --- /usr/local/etc/rc.d/tomcat7.orig 2011-09-06 12:25:45.000000000 -0700
> +++ /usr/local/etc/rc.d/tomcat7 2011-09-06 12:26:17.000000000 -0700
> @@ -4,7 +4,7 @@
> #
>
> # PROVIDE: tomcat7
> -# REQUIRE: NETWORKING SERVERS
> +# REQUIRE: NETWORKING SERVERS clear_tmp
> # BEFORE: DAEMON
> # KEYWORD: shutdown
>
> ========== END PATCH EXCERPT ==========
--
Nothin' ever doesn't change, but nothin' changes much.
-- OK Go
Breadth of IT experience, and depth of knowledge in the DNS.
Yours for the right price. :) http://SupersetSolutions.com/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4E667606.7010300>
