Skip to content

Instantly share code, notes, and snippets.

@fedesilva
Forked from dkhenry/play2.service
Created August 24, 2016 20:52
Show Gist options
  • Save fedesilva/6dfb9a2197af09ddbc94502ed2c72f38 to your computer and use it in GitHub Desktop.
Save fedesilva/6dfb9a2197af09ddbc94502ed2c72f38 to your computer and use it in GitHub Desktop.
Systemd script for the Play Framework
[Unit]
Description=Play2 Server for <site>
After=network.target
 
[Service]
Type=simple
PIDFile=<path>/RUNNING_PID
 
ExecStartPre=/bin/sh -c 'cd <path> ;/bin/rm RUNNING_PID ; sbt clean compile stage'
ExecStart=<path>/target/start
ExecStop=/bin/kill $MAINPID
ExecStopPost=/bin/rm <path>/RUNNING_PID
ExecRestart=/bin/kill $MAINPID
Restart=true
 
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment