-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
change default pid location from /var/run/gitea.pid to /run/gitea.pid #12391
Conversation
gitea already defaults to the location shown in the example, so the argument doesn't have any effect. Instead point to a custom location to make it more obvious.
…gitea.pid The former one is only kept for backwards compat according to https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch05s13.html, and is a symlink to `/run/` on modern distributions.
unfortunately breaking because it will need to be noted on the release notes even if /var/run is just a symlink. |
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.
Thanks for PR :) This is indeed a beneficial change.
I am hesitant to accept this change as there are many Gitea users running on non-modern OSes that don't have the /run/
directory. A possible solution (as suggested by @zeripath in chat) would be to compile the option in via linker, similar to how we provide the option for various OSes to support FHS compliance. That way Gitea can maintain /var/run as default, but would allow nix, and other OSes to set the default as needed when packaging.
@@ -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: "/run/gitea.pid", |
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.
If we moved this value out in to a var then this could be made compile/link time settable
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.
Value: "/run/gitea.pid", |
Can you give an example of such other variables that can be set at link time? I'm not really sure I understand what's proposed. On the other hand, I'm not sure if it's much of an issue in general - What OSes still don't have IMHO the gitea upstream default should not be the deprecated |
@flokli The version variable for example is set at link time: https://github.com/go-gitea/gitea/blob/master/Makefile#L88 |
@flokli also see: https://docs.gitea.io/en-us/install-from-source/#changing-the-default-custompath-customconf-and-appworkpath Which is how you can build a FHS compliant Gitea |
per @zeripath's suggestion, if |
#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>
@flokli Thanks for the idea to fix this! |
Thanks for taking over! I really couldn't find the time to do this.
However, I still think /run/... should be the default in giteas codebase, and old distributions should set it to /var/run/..., not gitea sticking with the old /var/run/... IMHO.
|
Centos 7 is the problem. |
Yeah, but then CentOS 7 should set this variable accordingly in their packaging script. Gitea shouldn't carry legacy paths...
|
The former one is only kept for backwards compat according to
https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch05s13.html, and is a
symlink to
/run/
on modern distributions.