[Feature & Proposal] Halting Log Output and Graceful Restart/Stop #4715

Closed
opened 2025-11-02 06:00:39 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @bagasme on GitHub (Jan 24, 2020).

Description

As @zeripath mentioned in #9930, we need a way to halt log output. This may be required for using logrotate for example.

We can introduce graceful restart and stop to achieve the feature mentioned above. In graceful stop, the Gitea process isn't immediately stopped, but let the remaining requests to be processed prior to stop. Graceful restart use similar technique, instead that new requests are served using new generation of Gitea process.

Originally created by @bagasme on GitHub (Jan 24, 2020). ## Description As @zeripath mentioned in #9930, we need a way to halt log output. This may be required for using `logrotate` for example. We can introduce graceful restart and stop to achieve the feature mentioned above. In graceful stop, the Gitea process isn't immediately stopped, but let the remaining requests to be processed prior to stop. Graceful restart use similar technique, instead that new requests are served using new *generation* of Gitea process.
Author
Owner

@stale[bot] commented on GitHub (Mar 24, 2020):

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

@stale[bot] commented on GitHub (Mar 24, 2020): This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.
Author
Owner

@stale[bot] commented on GitHub (Apr 7, 2020):

This issue has been automatically closed because of inactivity. You can re-open it if needed.

@stale[bot] commented on GitHub (Apr 7, 2020): This issue has been automatically closed because of inactivity. You can re-open it if needed.
Author
Owner

@lonix1 commented on GitHub (May 19, 2020):

@bagasme I'm also handling log rotation myself, using logrotate. (Must do so, so can feed logs into log management stack.)

The gitea container already runs s6, so log rotation would be very easy.

With s6 I would typically do:

s6-svc -1 /etc/s6/gitea/      # or -2 for SIGUSR2

Which would make s6 send signal SIGUSR1 to the app, which should force the app to release and reopen the log file (which has just been rotated).

But of course gitea doesn't currently support reopening of its log file.

Have you found a workaround in the meantime?

@lonix1 commented on GitHub (May 19, 2020): @bagasme I'm also handling log rotation myself, using logrotate. (Must do so, so can feed logs into log management stack.) The gitea container already runs s6, so log rotation would be very easy. With s6 I would typically do: ```` s6-svc -1 /etc/s6/gitea/ # or -2 for SIGUSR2 ```` Which would make s6 send signal `SIGUSR1` to the app, which should force the app to release and reopen the log file (which has just been rotated). But of course gitea doesn't currently support reopening of its log file. Have you found a workaround in the meantime?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#4715