-
Notifications
You must be signed in to change notification settings - Fork 40
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
Compatibility with signal-hook
#528
Comments
@bytefall I already have this on my radar. I will add a builder parameter to the node and the waitset to explicitly disable signal handler registration. The PR should be out in the next week or so. By the way, we created our own signal handler since we must be able to certify the code according to ISO26262 for ASIL D so that iceoryx2 can also run in mission-critical systems like a car's emergency break. |
@bytefall btw. if you do not need all the If you just want to terminate on SIGINT (CTRL+c) or SIGTERM ( while node.wait(CYCLE_TIME).is_ok() {
// ...
} or if you want to handle it a bit more explicitly while !stop.load(Ordering::Relaxed) {
match node.wait(CYCLE_TIME) {
Ok(()) => my_algorithm(),
Err(NodeWaitFailure::TerminationRequest) => {
// someone called for instance kill PID
stop.store(true, Ordering::Relaxed);
}
Err(NodeWaitFailure::Interrupt) => {
// someone pressed CTRL+c
stop.store(true, Ordering::Relaxed);
}
}
} |
Thanks @elfenpiff for addressing this requirement. I'm not developing any mission-critical systems so the certification doesn't make any difference to me. Talking from the perspective of a general developer on the Internet, who is looking for d-bus alternatives. |
@bytefall you said the required keyword "d-bus alternatives". We wanted to promote iceoryx2 as d-bus alternative in the near future when some other features like request response are implemented and the documentation is a bit mature. Could you share some of your d-bus use cases with us? |
Sure, I have a patch for dosbox that adds ability to communicate via d-bus. Also there is a TUI front-end to control dosbox.
Out of curiosity.
Basically, as you specified in the docs, "Request-Response" is missing. |
…ion-optional [#528] make signal registration optional
@bytefall I added the ability to disable the automatic signal handling on the When you write: let node = NodeBuilder::new()
.name(&"my_little_node".try_into()?)
.signal_handling_mode(SignalHandlingMode::Disabled)
.create::<ipc::Service>()?;
/// this will no longer fetch SIGINT or SIGTERM
while node.wait(CYCLE_TIME).is_ok() {
} |
First of all, thank you for your library!
There is a quite popular signal-hook crate. Basic service that uses subscriber looks looks like this:
Pressing
Ctrl+C
stops the program (you will see "Bye"). Uncommentednode.wait
code preventssignal-hook
to handleCtrl+C
so that the program keeps running.I couldn't find a crate feature to disable signal handling (using only
logger_log
feature, which is very helpful).The text was updated successfully, but these errors were encountered: