https://bz.apache.org/bugzilla/show_bug.cgi?id=63041

--- Comment #28 from Konstantin Kolinko <knst.koli...@gmail.com> ---
(In reply to Rainer Jung from comment #27)
> Excellent analysis!
> 
> I *think* the "&" at the end of the line is only useful, if a pipe command
> is actually being used. So one could put it into the construction of the
> string variable to which we pipe, just as we prefix the command with "|" we
> could suffix it with "&".
> 

Interesting. A good idea.

(In reply to Mark Thomas from comment #26)
> 
> That final "&" prevents the eval command being written to the console when
> using catalina.sh start

So it could be >/dev/null ?


(In reply to Mark Thomas from comment #26)
> Assuming the above is correct I think we have two options:
> 
> 1. Revert the "&" -> "&&" change. systemd users (and possibly others) will
> be required to use a PID file and to tell systemd where to find that file.
>

1. I wonder how OP's configuration with systemd was written. Is it some
home-grown configuration (and can be fixed in place), or it has to be fixed
somewhere upstream.

Personally, I always use a PID file.

Thank you Rainer Jung for sharing your configuration.

> PIDFile=XXXKPDT_CATALINA_PIDXXX

If the PID file is created by catalina.sh, I guess one has to set CATALINA_PID
somewhere (e.g. with 'Environment=' line).


2. I am not sure how the '&' recipe plays with nohup.

It might work.

I just fear that nohup might create a nohup.out file.  (It sends "nohup java"
process into background without redirecting its output. The nohup.out file is
created if nohup thinks that its output is a terminal. Is it able to detect
redirection of a compound command?)

Documentation:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/nohup.html

(In reply to Mark Thomas from comment #20)
> (In reply to Konstantin Kolinko from comment #19)
> > An idea: use a named pipe (a FIFO special file) to solve the original bug
> > 53930.
> 
> If I am understanding this correctly that would mean:
> 
> - reverting r1848046 and r1850829 for 9.0.x
> - reverting r1848048 and r1850830 for 8.5.x
> - reverting r1848049 and r1850831 for 7.0.x
> 
> Re-opening bug 53930 and resolving it as WONTFIX - suggesting that a named
> pipe is used.

I am not sure whether configuring a pipe externally will work. It is just that
if one uses the pipe, we can keep the original "eval" line, and the overall
patch is less intrusive.

Support for setting up the pipe could be in catalina.sh.

It needs some thought and some testing.

1) I wonder how 'touch "$CATALINA_OUT"' command will interact with a pipe.

Maybe it has to be skipped if the file exists.

2) catalina.sh has code that checks existing PID file to prevent double starts.

If the code that manages the pipe is places after the checks, it can benefit
from them.

3) I wonder whether it is better to start the process reading from pipe before
or after Tomcat. I guess that with a usual (non-named) pipe it is started after
Tomcat.

I've read that a process writing to a pipe will hang if there is no one
reading.


My preference is to revert and to start planning a new patch from there.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to