Page History
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
[Unit] Description=Jetty for SOS JS7 JOC Cockpit After=syslog.target After=network.target [Service] # Set JAVA_HOME environment variable if necessary # Environment="JAVA_HOME=/opt/java/jdk-17.0.2" # Environment="JAVA=/opt/java/jdk-17.0.2/bin/java" # Environment="JAVA_OPTIONS=" Environment="JETTY_RUN=/var/run/js7" Environment="JETTY_PID=/var/run/js7/js7_joc_1.pid" Type=forking PIDFile=/var/run/js7/joc.pid ExecStartPre=+/bin/mkdir -p /var/run/js7 ExecStartPre=+/bin/chown ap:ap /var/run/js7 ExecStartPost=/bin/sleep 1 ExecStart=/bin/sh -c "/home/js/joc/jetty/bin/jetty.sh start" ExecStop=/bin/sh -c "/home/js/joc/jetty/bin/jetty.sh stop" ExecReload=/bin/sh -c "/home/js/joc/jetty/bin/jetty.sh restart" User=js StandardOutput=journal+console StandardError=journal+console SuccessExitStatus=143 TimeoutStopSec=60 [Install] WantedBy=multi-user.target |
...
- Sub-directories in the
/var/run
directory are ephemeral, i.e. they will be dropped on reboot of the server. If a sub-directory such asjs7
is used then it has to be created by the service file. - Jetty Environment Variables
- Configuration
Environment="JETTY_RUN=/var/run/js7"
Environment="JETTY_PID=/var/run/js7/js7_joc_1.pid"
- The variables specify the directory and the path of the PID file used by Jetty.
- Configuration
- PID FileDirectory
- Configuration
PIDFile=/var/run/js7/joc.pid
ExecStartPre=+/bin/mkdir -p /var/run/js7
ExecStartPre=+/bin/chown js:js /var/run/js7
- The
+
preceeding the commends indicates that they will be executed by the root account. - The commands create the
js7
sub-directory and hand-over ownership to thejs
account and group.
- Configuration
...
Overview
Content Tools