Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#32947 - [tomcat7] Systemd service script imposing java-7-openjdk

Attached to Project: Arch Linux
Opened by Romain Bisse (RomainBisse) - Monday, 03 December 2012, 10:08 GMT
Last edited by Guillaume ALAUX (galaux) - Thursday, 28 March 2013, 12:43 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Guillaume ALAUX (galaux)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

The Java home seems to be "hard coded" in the systemd service script for Tomcat 7 :
Environment=TOMCAT_JAVA_HOME=/usr/lib/jvm/java-7-openjdk

Thus, the jsvc command fails with any other jdk.


Additional info:
* package version(s) : 7.0.33-1
This task depends upon

Closed by  Guillaume ALAUX (galaux)
Thursday, 28 March 2013, 12:43 GMT
Reason for closing:  Won't implement
Comment by Guillaume ALAUX (galaux) - Sunday, 09 December 2012, 16:28 GMT
As stated in the systemd.service man page [0], service files are unit *configuration* files. So there is no such thing as hardcoding in a service configuration file.

The TOMCAT_JAVA_HOME set in this service file uses Arch Linux's default JAVA_HOME which is OpenJDK's. If you would like to use it with another path, just copy the service file to /etc/systemd/system/ and apply your config there as stated in the wiki [1].

[0] http://0pointer.de/public/systemd-man/systemd.service.html
[1] https://wiki.archlinux.org/index.php/Systemd#Replacing_provided_unit_files
Comment by Romain Bisse (RomainBisse) - Monday, 10 December 2012, 10:31 GMT
Ok, I missed the point about services configuration in /etc/systemd/system, this is one solution.
However, can we find any dynamic way of starting the service, using $JAVA_HOME for example ?
If not, the wiki[0] should mention the need of a specific configuration file for OpenJDK 6.

[0] https://wiki.archlinux.org/index.php/Tomcat#Systemd
Comment by Guillaume ALAUX (galaux) - Thursday, 21 February 2013, 17:45 GMT
Damn I thought I had given an answer to your question. I'm currently bringing modifications to the openjdk package so that it provides a link that points to a default runtime environment. Tomcat would then refer to this link by default and could be modified using the /etc/systemd thing we were talking about earlier.

I will close this bug report once this is implemented.
Comment by Guillaume ALAUX (galaux) - Friday, 15 March 2013, 08:29 GMT
> However, can we find any dynamic way of starting the service, using $JAVA_HOME for example ?
systemd service files do not inherit environment variable such as JAVA_HOME. This is a normal behavior.

As Arch currently provides only one JDK in its official repositories there *currently* is no need for official multi-JDK support. Still I already have a pretty good idea about how to do it (see [0]). This should come up when OpenJDK8 is out. So I'm postponing this and will bring it back with OpenJDK8 integration.

To answer your question: systemd in its last version provides configuration files à la .d/*.conf (see Tom's email [1]). This could answer your need in the meantime.

[0] https://mailman.archlinux.org/pipermail/arch-dev-public/2013-February/024412.html
[1] https://mailman.archlinux.org/pipermail/arch-dev-public/2013-March/024582.html

Loading...