Skip to content
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

signal: Remove os.Kill (SIGKILL) from signal list as it cannot be caught #9396

Open
mohamedawnallah opened this issue Dec 29, 2024 · 0 comments
Labels
enhancement Improvements to existing features / behaviour

Comments

@mohamedawnallah
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Currently, the signal list includes os.Kill (which corresponds to SIGKILL), but this signal cannot be caught by the program. Since SIGKILL is a non-catchable signal used to immediately terminate processes, including it in the signal list may not have the desired effect.

lnd/signal/signal.go

Lines 132 to 137 in a388c1f

signalsToCatch := []os.Signal{
os.Interrupt,
os.Kill,
syscall.SIGTERM,
syscall.SIGQUIT,
}

Describe the solution you'd like

Remove os.Kill from the signal list to ensure that only catchable signals like SIGTERM,SIGQUIT, and os.Interrupt (which corresponds to SIGINT) are handled by the program.

Describe alternatives you've considered

None. Since SIGKILL cannot be caught, including it in the list seems not achieving any functional purpose. Removing it would simplify and streamline the signal handling process.

Additional context

This opportunity for improvement was noticed while working on PR #9395.

@mohamedawnallah mohamedawnallah added the enhancement Improvements to existing features / behaviour label Dec 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvements to existing features / behaviour
Projects
None yet
Development

No branches or pull requests

1 participant