https://www.eclipse.org/jetty/documentation/9.4.19.v20190610/startup-unix-service.html
Here is the result of "service jetty check":
root@localhost:~# service jetty check
Jetty NOT running
JAVA = /usr/bin/java
JAVA_OPTIONS = -Djetty.home=/opt/jetty/jetty-distribution-9.4.19.v20190610 -Djetty.base=/opt/web/jgobase -Djava.io.tmpdir=/opt/jetty/temp
JETTY_HOME = /opt/jetty/jetty-distribution-9.4.19.v20190610
JETTY_BASE = /opt/web/jgobase
START_D = /opt/web/jgobase/start.d
START_INI = /opt/web/jgobase/start.ini
JETTY_START = /opt/jetty/jetty-distribution-9.4.19.v20190610/start.jar
JETTY_CONF = /opt/jetty/jetty-distribution-9.4.19.v20190610/etc/jetty.conf
JETTY_ARGS = jetty.state=/opt/web/jgobase/jetty.state jetty-started.xml
JETTY_RUN = /var/run/jetty
JETTY_PID = /var/run/jetty/jetty.pid
JETTY_START_LOG = /var/run/jetty/jetty-start.log
JETTY_STATE = /opt/web/jgobase/jetty.state
JETTY_START_TIMEOUT = 60
RUN_CMD = /usr/bin/java -Djetty.home=/opt/jetty/jetty-distribution-9.4.19.v20190610 -Djetty.base=/opt/web/jgobase -Djava.io.tmpdir=/opt/jetty/temp -jar /opt/jetty/jetty-distribution-9.4.19.v20190610/start.jar jetty.state=/opt/web/jgobase/jetty.state jetty-started.xml
Does it matter that the JAVA_OPTIONS field does not match the tutorial? The tutorial has a reference to -Djava.logs entry (and also a -Djetty.state entry).
Here are the file permissions from $JETTY_BASE:
root@localhost:/opt/web/jgobase# ls -l
total 12
drwxr-xr-x 2 jetty root 4096 Aug 7 22:05 logs
-rw-r--r-- 1 jetty root 2427 Aug 7 20:49 start.ini
drwxr-xr-x 2 jetty root 4096 Aug 7 20:25 webapps
Here is the line from /etc/passwd for the "jetty" user:
jetty:x:1000:1000::/opt/jetty/temp:/bin/false
It seems the code is trying to literally use "/libs" instead of $JETTY_BASE/libs.
Here is what we have from start.ini. Basically just using defaults.
# ---------------------------------------
# Module: console-capture
# Redirects JVMs console stderr and stdout to a log file,
# including output from Jetty's default StdErrLog logging.
# ---------------------------------------
--module=console-capture
## Logging directory (relative to $jetty.base)
# jetty.console-capture.dir=logs
## Whether to append to existing file
# jetty.console-capture.append=true
## How many days to retain old log files
# jetty.console-capture.retainDays=90
## Timezone of the log timestamps
# jetty.console-capture.timezone=GMT
As an experiment, changing the above to the following does allow the program to work as a service:
jetty.console-capture.dir=/opt/web/jgobase/logs
But I find this worrying, given that the comment explicitly says "relative to $jetty.base". That seems to imply somewhere in the process of running the service $jetty.base is being interpreted as a blank or empty field.
One last note, a collaborator has made a file and placed it in the following location.
/etc/systemd/system/jetty.service
I am wondering if this file is involved in the error. It wasn't listed in the tutorial as being part of the process of creating a service. Could this be intercepting in a way that causes the code to lose the correct logging address?
Here is what is in it.
[Unit]
Description=Jetty
After=network-online.target
[Service]
Type=simple
User=jetty
Group=jetty
ExecStart=/usr/bin/java -jar /opt/jetty/jetty-distribution-9.4.19.v20190610/start.jar jetty.home=/opt/jetty/jetty-distribution-9.4.19.v20190610 jetty.base=/opt/web/jgobase jetty.http.port=8080
ExecStop=/bin/kill ${MAINPID}
SuccessExitStatus=143
[Install]
WantedBy=multi-user.target
Thank you for any assistance!