`/etc/default/tomcat9` resets existing `JAVA_OPTS`
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
tomcat9 (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Ubuntu Release:
> Description: Ubuntu 22.04.3 LTS
> Release: 22.04
Package version:
> tomcat9:
> Installed: 9.0.58-1ubuntu0.1
> Candidate: 9.0.58-1ubuntu0.1
> Version table:
> *** 9.0.58-1ubuntu0.1 500
> 500 http://
> 100 /var/lib/
> 9.0.58-1 500
> 500 http://
Offending section from `/etc/default/
```sh
# You may pass JVM startup parameters to Java here. If you run Tomcat with
# Java 8 instead of 9 or newer, add "-XX:+UseG1GC" to select a suitable GC.
# If unset, the default options will be: -Djava.
JAVA_OPTS=
```
Particularly, the comment states _"If unset, the default options will be: `-Djava.
However, the code doesn't do that; it just disregards any previous value that `JAVA_OPTS` might have had.
Rather, to reflect the intent, the code should do something along the lines of:
```sh
if [ -z "$JAVA_OPTS" ] ; then
JAVA_
fi
```
Why is this a problem?
If a systemd unit drop-in (`/etc/
Moreover, the main `/lib/systemd/