I am trying to run Sphinx4-Http-server on RHEL. If I am in the directory /home/alex/Sphinx4-HTTP-server
and run the command /home/alex/apache-maven-3.6.1/bin/mvn exec:java -Dexec.mainClass="org.jitsi.sphinx4http.server.HttpServer"
, then the server will run. However, when I make a .service
file for the program (as shown below), I get a program error (specifically java.lang.ClassNotFoundException: "org.jitsi.sphinx4http.server.HttpServer"
). Using this file on Ubuntu works (with adjusted path names), and using similar .service
files for other programs on RHEL works. Why would the program run in the shell but not with systemd, even though the systemd file works on another system and similar systemd files work on the same system? How would I go about fixing it?
sphinx.service
:
[Service]
WorkingDirectory=/home/alex/Sphinx4-HTTP-server
ExecStart=/home/alex/apache-maven-3.6.1/bin/mvn exec:java -Dexec.mainClass="org.jitsi.sphinx4http.server.HttpServer"
Restart=always
StandardOutput=syslog
SyslogIdentifier=sphinx
User=alex
[Install]
WantedBy=multi-user.target
root
. I've also looked at all the solutions suggested at "Why doesn't my app work under systemd when I can run it directly?", but none of them appear to apply here. – alexwho314 May 09 '19 at 19:35