https://bugzilla.redhat.com/show_bug.cgi?id=842346
--- Comment #4 from Ivan Afonichev <ivan.afonichev(a)gmail.com> ---
"
First of all, for service type forking, you have to specify PIDFile=,
unless systemctl status reports the invalid state, when daemon is
running. However, even if you use the PIDFile, you will get state failed
on systemctl stop because jvm ends with code 143. Because of that, I've
used a different approach to yours - please consider if that's usable
for you or not
I've removed a lot of bloat, which is not needed under systemd - like
you don't need to source /etc/tomcat/tomcat.conf as
EnvironmentFile=/etc/tomcat/tomcat.conf do the same for you. Or the ugly
part with nohup su tomcat -c, for which you have to call parseArguments
and export the environment for /usr/sbin/tomcat is useless, becase of
User=/Group=
For that reason I've simplified the structure of scripts and removed all
crap needed for sysvinit. You can take a look at Java:packages/tomcat
[1] - the most important files are tomcat-7.0-tomcat-sysd [2],
tomcat-7.0.service [3] and tomcat-7.0-jsvc.service [4].
For jsvc, I've merged the separate script into one, to reuse most of the
parts. But this part should get an another care - I would say
-jsvc.service can be Type=forking with appropriate PIDFile=, but I did
not want to make the differences between those two.
As an alternative, tomcat.service started with
CapabilityBoundingSet=CAP_NET_BIND_SERVICE can bind to port 80 and run
as tomcat user, but this will need to be checked first. But in case it's
true, this can make the -jsvc service and package obsoleted.
[1]
https://build.opensuse.org/package/files?package=tomcat&project=Java%...
[2]
https://build.opensuse.org/package/view_file?file=tomcat-7.0-tomcat-sysd&...
[3]
https://build.opensuse.org/package/view_file?file=tomcat-7.0.service&...
[4]
https://build.opensuse.org/package/view_file?file=tomcat-7.0-jsvc.service...
"
--
You are receiving this mail because:
You are on the CC list for the bug.