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

Support different signals than SIGKILL #8

Closed
hiddewie opened this issue Apr 25, 2023 · 6 comments
Closed

Support different signals than SIGKILL #8

hiddewie opened this issue Apr 25, 2023 · 6 comments

Comments

@hiddewie
Copy link

The kill command supports the command-line option to specify the signal sent to the killed processes.

https://www.man7.org/linux/man-pages/man1/kill.1.html, the option --signal.

Sending other signals than SIGKILL can be useful to reload the process listening on a certain port (like nginx), or gracefully shutdown a service, or invoke other user-defined functionality.

Relevant code:

kill(pid, Signal::SIGKILL).map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))

@NachiketNamjoshi
Copy link
Contributor

NachiketNamjoshi commented Apr 26, 2023

I can pick this up. @jkfran lmk if you have any issues/ideas on this.

@jkfran
Copy link
Owner

jkfran commented Apr 26, 2023

@NachiketNamjoshi, Thank you so much! My only suggestion is to keep using clap to parse this new argument. Apart from that, you are welcome to be creative 😄

@0kate
Copy link
Contributor

0kate commented Apr 30, 2023

@jkfran I have added some changes for additional options to specify different signal types! (SIGTERM and SIGKILL only now)
I would appreciate it if you could check a PR below 🙏
#13

@0kate
Copy link
Contributor

0kate commented May 2, 2023

@jkfran
Thank you review and merging PR above! Could I continue to add support for other signal types?

@jkfran
Copy link
Owner

jkfran commented May 2, 2023

@jkfran Thank you review and merging PR above! Could I continue to add support for other signal types?

I think Sigterm and Sigkill are enough for killport. Let's see if we get requests about supporting the other signals. Feel free to contribute to any of the other issues.

@jkfran
Copy link
Owner

jkfran commented May 2, 2023

This issue was solved on #13

Killport will now use sigterm by default and it is possible to use sigkill by using -s or --signal.

Thank you so much @0kate for contributing to this project.

@jkfran jkfran closed this as completed May 2, 2023
NachiketNamjoshi added a commit to NachiketNamjoshi/killport that referenced this issue May 12, 2023
Adds support to send all signals available in `nix::sys::signal::Signal`

✅ Closes: jkfran#8

Signed-off-by: NachiketNamjoshi <nachiketnamjoshi@gmail.com>
NachiketNamjoshi added a commit to NachiketNamjoshi/killport that referenced this issue May 13, 2023
Adds support to send all signals available in `nix::sys::signal::Signal`

✅ Closes: jkfran#8

Signed-off-by: NachiketNamjoshi <nachiketnamjoshi@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants