Open rutsky opened 8 years ago
In my C++ version, I've put in some wrappers to handle this problem. It should exit gracefully when a SIGINT happens (either via Ctrl+C or kill). Take a look at those.
Thanks for the info @bandi13!
So generally it can be implemented as
nbd = open(dev_file, O_RDWR);
...
ioctl(nbd, NBD_DISCONNECT);
in SIGINT signal handler: https://github.com/bandi13/BUSE-CPP/blob/master/buse.cpp#L208
@bandi13, I checked your implementation and think that issue #4 is related to your version too.
Just don't do stuff that always should be done inside assert()
macro.
@acozzette can you please close this issue? In my opinion it has been resolved. Thanks ;)
I think the only correct way of terminating BUSE-based NBD server is to disconnect the NBD device:
It would be nice to properly handle Ctrl+C to achieve same result (currently Ctrl+C leads to exit code 130, i.e. terminated with SIGINT),