Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
If the /var/run (aka /run) folder doesn't exist for the PID file, cre…
…ate it CentOS 7 and many other recent Linuxes have switched to a non-persistent (tmpfs) /run folder, with /var/run being a symbolic link to the tmpfs /run mount. The RPM creates the correct folder in /var/run for the PID file, but on reboot, that file is gone. There are many ways to fix it. This way will work on older systemd versions.
- Loading branch information
9c74f70
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the PID file for if you're using systemd?
9c74f70
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change doesn't add a PID file, but a directory
/var/run/{appName}
that can be used for PID files.The play framework by default creates a PID file, no matter what systemloader is in use.
This is not necessary for systemd, but provides a default infrastructure for an application that requires it.
9c74f70
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the play framework creates the PID file no matter what, as muuki88 said, if the folder containing the PID-file-to-be doesn't exist, the service will fail to start. While systemd doesn't require PID files, they are sometimes useful for scripts, so it's a double bonus to make sure PID files can be created.