-
-
Save TimFoerster/53ff13645fdcf3009e3202447fb841ea to your computer and use it in GitHub Desktop.
Systemd script for the Play Framework
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Play2 Service for <service-name> | |
After=network.target | |
[Service] | |
Type=simple | |
PIDFile=<path>/RUNNING_PID | |
WorkingDirectory=<path> | |
ExecStartPre=/bin/rm -f <path>/RUNNING_PID | |
ExecStart=<path>/bin/<service-name> -Dconfig.resource=production.conf -Duser.timezone=UTC | |
ExecStop=/bin/kill $MAINPID | |
ExecStopPost=/bin/rm -f <path>/RUNNING_PID | |
ExecReload=/bin/kill $MAINPID | |
Restart=always | |
User=<user> | |
Group=<usergroup> | |
# See http://serverfault.com/a/695863 | |
SuccessExitStatus=143 | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tested with cent OS 7 & 8 without producing any errors or warnings.