aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/web.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-08-15 21:15:27 +0100
committerGitHub <noreply@github.com>2020-08-15 21:15:27 +0100
commitac3cfad23dc08f24d2bb8914313162e281de7326 (patch)
tree113514441fdaeeecafadcb11346ad589e7f91c5a /cmd/web.go
parentee97e6a66a7bec9547af31c93a5eef7c19a32c54 (diff)
downloadgitea-ac3cfad23dc08f24d2bb8914313162e281de7326.tar.gz
gitea-ac3cfad23dc08f24d2bb8914313162e281de7326.zip
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>
Diffstat (limited to 'cmd/web.go')
-rw-r--r--cmd/web.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/cmd/web.go b/cmd/web.go
index 6efadb9419..f0e1b16e7f 100644
--- a/cmd/web.go
+++ b/cmd/web.go
@@ -41,7 +41,7 @@ and it takes care of all the other things for you`,
},
cli.StringFlag{
Name: "pid, P",
- Value: "/var/run/gitea.pid",
+ Value: setting.PIDFile,
Usage: "Custom pid file path",
},
},
@@ -110,7 +110,8 @@ func runWeb(ctx *cli.Context) error {
// Set pid file setting
if ctx.IsSet("pid") {
- setting.CustomPID = ctx.String("pid")
+ setting.PIDFile = ctx.String("pid")
+ setting.WritePIDFile = true
}
// Perform global initialization