1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Make the default PID file compile-time settable (#12485)

#12391 offered to change the default PID file from /var/run/gitea.pid however in discussion it was decided that this could break users of older systems. An alternative was offered that we could make the PID file compile/link time settable.

This PR does this, and changes the name of the setting from CustomPID to simply PIDFile. It also updates the from-source docs to show how to change the compiler settings to do this.

Closes #12391

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Florian Klink <flokli@flokli.de>
This commit is contained in:
zeripath
2020-08-15 21:15:27 +01:00
committed by GitHub
parent ee97e6a66a
commit ac3cfad23d
7 changed files with 12 additions and 9 deletions

View File

@@ -382,7 +382,8 @@ var (
Cfg *ini.File
CustomPath string // Custom directory path
CustomConf string
CustomPID string
PIDFile = "/var/run/gitea.pid"
WritePIDFile bool
ProdMode bool
RunUser string
IsWindows bool
@@ -535,8 +536,8 @@ func SetCustomPathAndConf(providedCustom, providedConf, providedWorkPath string)
func NewContext() {
Cfg = ini.Empty()
if len(CustomPID) > 0 {
createPIDFile(CustomPID)
if WritePIDFile && len(PIDFile) > 0 {
createPIDFile(PIDFile)
}
if com.IsFile(CustomConf) {