Skip to content

Instantly share code, notes, and snippets.

@nicopaez
Last active April 24, 2018 16:19
Show Gist options
  • Save nicopaez/a2d336d6c876f728a6189cde50e8a81f to your computer and use it in GitHub Desktop.
Save nicopaez/a2d336d6c876f728a6189cde50e8a81f to your computer and use it in GitHub Desktop.
# /etc/systemd/system/javawebapp.service
[Unit]
Description=Job that runs the JavaWebApp
After=syslog.target
[Service]
WorkingDirectory=/opt/javawebapp
ExecStart=/usr/bin/java -Djava.security.egd=file:/dev/./urandom -Dserver.port=9000 -jar javawebapp.war --spring.profiles.active=prod &
ExecStop=/bin/kill -TERM $MAINPID
SuccessExitStatus=143
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment