An example service
definition under /etc/systemd/system/foo.service
:
[Unit]
Description=Foo Service
After=network.target
[Service]
Type=simple
# Place config/application*.properties under working directory
WorkingDirectory=/var/local/foo
ExecStart=/usr/bin/java -jar /opt/foo/foo-service-1.0.0-exec.jar
User=user
Group=user
UMask=0002
# Note: Sending a SIGINT (as in CTRL-C) results in an exit code of 130 (which is normal)
KillMode=process
KillSignal=SIGINT
SuccessExitStatus=130
TimeoutStopSec=10
StandardOutput=journal
StandardError=journal
[Install]
WantedBy=multi-user.target