[PR #22] [MERGED] Handle signals and gracefully shut down, waiting for clients #66

Closed
opened 2026-02-26 18:33:13 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/decke/smtprelay/pull/22
Author: @JonathonReinhart
Created: 3/18/2021
Status: Merged
Merged: 4/1/2021
Merged by: @JonathonReinhart

Base: masterHead: smtpd-shutdown


📝 Commits (1)

  • 1b7b551 Handle signals and gracefully shut down server

📊 Changes

1 file changed (+42 additions, -5 deletions)

View changed files

📝 main.go (+42 -5)

📄 Description

Handle SIGINT, SIGQUIT, and SIGTERM by gracefully shutting down the SMTP server and waiting for all child connections to finish.

This PR is a result of discussions on #13 and is based loosely on grafana#11.

One can easily verify the behavior by:

  • Run smtprelay
  • Telnet to the server
  • Press Ctrl+C in smtprelay and observe that it is still running
  • Close the telnet connection and observe smtprelay stop

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/decke/smtprelay/pull/22 **Author:** [@JonathonReinhart](https://github.com/JonathonReinhart) **Created:** 3/18/2021 **Status:** ✅ Merged **Merged:** 4/1/2021 **Merged by:** [@JonathonReinhart](https://github.com/JonathonReinhart) **Base:** `master` ← **Head:** `smtpd-shutdown` --- ### 📝 Commits (1) - [`1b7b551`](https://github.com/decke/smtprelay/commit/1b7b551f65d6e6294c0c9ec71e43a67d03113669) Handle signals and gracefully shut down server ### 📊 Changes **1 file changed** (+42 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `main.go` (+42 -5) </details> ### 📄 Description Handle `SIGINT`, `SIGQUIT`, and `SIGTERM` by gracefully shutting down the SMTP server and waiting for all child connections to finish. This PR is a result of discussions on #13 and is based loosely on grafana#11. One can easily verify the behavior by: - Run `smtprelay` - Telnet to the server - Press <kbd>Ctrl</kbd>+<kbd>C</kbd> in `smtprelay` and observe that it is still running - Close the telnet connection and observe `smtprelay` stop --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 18:33:13 +03:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/smtprelay#66
No description provided.