forked from evolix/ansible-roles
tomcat: Don't use forking in tomcat.service
Having `ExecStart=[…]/catalina.sh run` and `Type=simple` result in tomcat doing everything systemd is expecting without the need to fork or adding a secondary daemon manager just for this tomcat service. That means that we don't need ExecStop anymore as the shutdown port is only there as a OS agnostic shutdown method. The jsvc (aka officially documented) method of launching tomcat use signals to stop the service just as systemd will when no ExecStop= is in the unit file so we know it will work properly. Moreover add the SyslogIdentifier= directive to make each tomcat easier to find in the system log.
This commit is contained in:
parent
82694ef5e9
commit
503806e9e6
|
@ -25,6 +25,7 @@ The **patch** part changes is incremented if multiple releases happen the same m
|
||||||
* mongodb: Deny the install on Debian 11 « Bullseye » when the version is unsupported
|
* mongodb: Deny the install on Debian 11 « Bullseye » when the version is unsupported
|
||||||
* mongodb: Support version 5.0 (for buster)
|
* mongodb: Support version 5.0 (for buster)
|
||||||
* mongodb: Allow to specify a mongodb version for buster & bullseye
|
* mongodb: Allow to specify a mongodb version for buster & bullseye
|
||||||
|
* tomcat : tomcat.service without forking and secondary daemon manager (`catalina.sh start` which is launched by `startup.sh` try to manage the tomcat daemon)
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
|
|
@ -7,9 +7,10 @@ WorkingDirectory=%h
|
||||||
Environment="CATALINA_BASE=%h"
|
Environment="CATALINA_BASE=%h"
|
||||||
EnvironmentFile=%h/conf/env
|
EnvironmentFile=%h/conf/env
|
||||||
UMask=0002
|
UMask=0002
|
||||||
ExecStart=/usr/share/tomcat{{ tomcat_version }}/bin/startup.sh
|
ExecStart=/usr/share/tomcat{{ tomcat_version }}/bin/catalina.sh run
|
||||||
ExecStop=/usr/share/tomcat{{ tomcat_version }}/bin/shutdown.sh
|
Restart=on-failure
|
||||||
Type=forking
|
|
||||||
|
SyslogIdentifier=tomcat-instance-%u
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=default.target
|
WantedBy=default.target
|
||||||
|
|
Loading…
Reference in a new issue