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

--- Comment #5 from Konstantin Kolinko <knst.koli...@gmail.com> ---
Re: r1782805

+if [ -n "${CATALINA_EXIT_DELAY:-}" ]; then
+    trap 'sleep ${CATALINA_EXIT_DELAY}' INT EXIT TERM
+fi

1. I suspect that "trap" won't see the value of CATALINA_EXIT_DELAY variable.

I think that you either need double quotes there (so that variable expansion
occurs), or add a line to export the variable, e.g.

export CATALINA_EXIT_DELAY


2. I think that whatever sets the CATALINA_EXIT_DELAY variable, can also
execute a "trap" command.

E.g. you can do it in bin/setenv.sh

In the systemd example, I suspect that you can write several commands
(connected with '&&') in the ExecStart line.

The original issue concerns all programs, started with systemd, so you have to
patch all other services that you are starting, not only Tomcat?

Why a Tomcat-specific patch?


Overall, an interesting feature, but
- if someone configures a significant delay, it will cause concerns
- it is a bit of a hack

3.
+#   CATALINA_EXIT_DELAY
+#                   (Optional) If started with systemd, add
+#                   'Environment=CATALINA_EXIT_DELAY=0.1' to your service file
+#                   to prevent systemd losing the last few log messages.
+#                   See https://github.com/systemd/systemd/issues/1347

1) POSIX says that sleep expects an integer number.

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/sleep.html

GNU implementation of sleep (in Linux) allows a floating point number and
allows suffixes (s m h d).

2) Maybe reference this bug as well.
At least it this bug has an example of how Tomcat can be run with systemd.

-- 
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