[systemd-devel] systemd eats up all spaces in my environment files

von Thadden, Joachim, SEVEN PRINCIPLES joachim.von-thadden at 7p-group.com
Thu Feb 18 10:27:15 UTC 2016


Seems to be a general problem with java/tomcat and not related to systemd. Sorry for the background noise. For anyone who is interested in the solution (which is for sure off topic) just <http://www.dict.cc/englisch-deutsch/background+noise.html> add the parameters directly to the catalina.properties like this:
cat <<END >>/etc/tomcat/catalina.properties
myPATH=/path to my/file
END

In case of Windows path names you have to escape the \ like:
myPATH=C:\\path to my\\file

Best regards
        Joachim

Am 17.02.2016 um 17:09 schrieb von Thadden, Joachim, SEVEN PRINCIPLES:

Hello!

I have an annoying problem with systemd and tomcat under CentOS. I try to set a parameter
via /etc/sysconfig/tomcat:
JAVA_OPTS="-DmyPATH=\"/path to my/file\""
JAVA_OPTS="-DmyPath=\"/path to my/file\""

It is read by systemd via /usr/lib/systemd/system/tomcat.service:
EnvironmentFile=-/etc/sysconfig/tomcat

But when I start, disregarding all my so far many attemts to quote the spaces in "/path to
my/file" I get an error:
# service tomcat status -l
Redirecting to /bin/systemctl status  -l tomcat.service
tomcat.service - Apache Tomcat Web Application Container
   Loaded: loaded (/usr/lib/systemd/system/tomcat.service; enabled)
   Active: failed (Result: exit-code) since Mi 2016-02-17 17:07:55 CET; 17s ago
  Process: 1453 ExecStop=/usr/libexec/tomcat/server stop (code=exited, status=1/FAILURE)
  Process: 1411 ExecStart=/usr/libexec/tomcat/server start (code=exited, status=1/FAILURE)
 Main PID: 1411 (code=exited, status=1/FAILURE)

Feb 17 17:07:55 scopebe systemd[1]: tomcat.service: main process exited, code=exited,
status=1/FAILURE
Feb 17 17:07:55 scopebe server[1453]: Java virtual machine used: /usr/lib/jvm/jre/bin/java
Feb 17 17:07:55 scopebe server[1453]: classpath used:
/usr/share/tomcat/bin/bootstrap.jar:/usr/share/tomcat/bin/tomcat-juli.jar:/usr/share/java/commons-daemon.jar
Feb 17 17:07:55 scopebe server[1453]: main class used: org.apache.catalina.startup.Bootstrap
Feb 17 17:07:55 scopebe server[1453]: flags used: -DmyPath="/path to my/file"
-XX:PermSize=2500m -XX:+HeapDumpOnOutOfMemoryError -XX:+AggressiveHeap
Feb 17 17:07:55 scopebe server[1453]: options used: -Dcatalina.base=/usr/share/tomcat
-Dcatalina.home=/usr/share/tomcat -Djava.endorsed.dirs=
-Djava.io.tmpdir=/var/cache/tomcat/temp
-Djava.util.logging.config.file=/usr/share/tomcat/conf/logging.properties
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
Feb 17 17:07:55 scopebe server[1453]: arguments used: stop
Feb 17 17:07:55 scopebe server[1453]: Fehler: Hauptklasse to konnte nicht gefunden oder
geladen werden
Feb 17 17:07:55 scopebe systemd[1]: tomcat.service: control process exited, code=exited
status=1
Feb 17 17:07:55 scopebe systemd[1]: Unit tomcat.service entered failed state.

From the (sorry, german) error "Fehler: Hauptklasse to konnte nicht ..." I can see that
systemd breaks up the string at the blanks of the path, making java think that "to" from
"path to my" is the main class to run. So how can I accomplish a working path with blanks
assingment?

Best regards
        Joachim





_______________________________________________
systemd-devel mailing list
systemd-devel at lists.freedesktop.org<mailto:systemd-devel at lists.freedesktop.org>
https://lists.freedesktop.org/mailman/listinfo/systemd-devel




--
Joachim von Thadden
Lead Technical Architect

SEVEN PRINCIPLES AG
Ernst-Dietrich-Platz 2
40882 Ratingen
Mobil: +49 162 261 64 66
Tel:   +49 2102 557 100
Fax:   +49 2102 557 101

E-Mail: joachim.von-thadden at 7p-group.com<mailto:joachim.von-thadden at 7p-group.com>
Web: www.7p-group.com<http://www.7p-group.com>
________________________________
Aufsichtsrat: Prof. Dr. h.c. Hans Albert Aukes
Vorstandsvorsitzender: Joseph Kronfli
Handelsregister: HRB 30660 | USt-ID-Nr.: DE197820124 | Steuer-Nr.: 218/5734/1640
Sitz der Gesellschaft: Köln | Registriergericht: Amtsgericht Köln

Der Inhalt dieser E-Mail ist ausschließlich für den bezeichneten Adressaten bestimmt. Wenn Sie nicht der vorgesehene Adressat dieser E-Mail oder dessen Vertreter sein sollten, beachten Sie bitte, dass jede Form der Veröffentlichung, Vervielfältigung oder Weitergabe des Inhalts dieser E-Mail unzulässig ist. Wir bitten Sie sofort den Absender zu informieren und die E-Mail zu löschen.
The information contained in this e-mail is intended solely for the addressee. Access to this e-mail by anyone else is unauthorized. If you are not the intended recipient, any form of disclosure, reproduction, distribution or any action taken or refrained from in reliance on it, is prohibited and may be unlawful. Please notify the sender immediately and destroy this e-mail.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20160218/95732ef1/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: joachim_von-thadden.vcf
Type: text/x-vcard
Size: 756 bytes
Desc: joachim_von-thadden.vcf
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20160218/95732ef1/attachment.vcf>


More information about the systemd-devel mailing list