-
Notifications
You must be signed in to change notification settings - Fork 122
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
Gracefully exit #46
Comments
Sure, could you say more about what about kanata's exit is not graceful? Would it need to catch an unwind and do some evdev cleanup before fully exiting? |
Here is my WIP commit: jian-lin/kanata@c9427c9 The problem is symlink is not deleted after I Ctrl-C kanata. Steps to reproduce:
|
Right, the issue you've run into is that Rust does not guarantee that https://lib.rs/crates/ctrlc might be of help |
Yeah, handling signals is a solution. However I prefer signal-hook because:
|
I would guess this is properly cleaned up and closed because the kernel knows about the kanata process and the fact that it has files related to the evdev interface open. So it's the kernel cleaning up as opposed to Rust code. This is in contrast to the symlink which is a filesystem concept independent of the input devices, so the kernel doesn't care to clean it up, and if the Rust code
The ctrlc does handle |
I don't think there's any issue in the repository that needs to be fixed, is that correct? Closing this issue, but feel free to re-open if I'm mistaken. |
I am trying to add a functionality of creating a symlink in
/dev/input/by-id/
for the newly created device/dev/input/eventxx
.Creating a symlink works if #45 is applied. However, kanata doesn't gracefully exit, which makes cleaning up the symlink rather hard if not impossible.
I would like to discuss about graceful exit.
The text was updated successfully, but these errors were encountered: