feat: support pid file.#610
Conversation
|
Why we need a pid file? |
|
You can also use that information (just do a |
|
I never needed that before but LGTM |
|
What happening if PID file already exist (ie: the app crash) ? app can be restarted without manually delete PID file ? To avoid any issue or conflict with System D, supervisor, or other kind of tools. I think PID file could be created only if -p flag or explicit configuration on app.ini are specified |
|
@0xBAADF00D You don't worry about the PID file exists or not. App can be restarted successfully if you remove the pid file. Just try the following command. gitea web
rm -rf custom/run/app.pid
kill -USR2 gitea_pid
cat custom/run/app.pid |
|
@appleboy What happens when a startup script also sets a PID? |
|
@Bwko What kind of start script do you use? |
|
what about windows ? it's work ? |
|
@ekozan Yes. Also working on Windows platform. |
|
Also working on start-stop-daemon command |
There was a problem hiding this comment.
Please check the error returned by os.MkdirAll().
|
@appleboy Thanks 👍 When you add metalmatze suggestions I'll LGT-M 😄 |
|
@Bwko Done! |
There was a problem hiding this comment.
Quoting bkcsoft on this one:
Overall, change the format to this instead whenever possible. Keeps errors(variables) bound to their context(block).
if err := os.Create(...); err != nil { [...] }
|
LGTM |
|
need @metalmatze approve |
|
@lunny @Bwko @metalmatze Thanks |

We can restart the app automatically by the following command.