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
EINTR causes: sigwaitinfo failed: errno=4; Shutting down. #261
Comments
|
Is my downstream bug report related? https://bugzilla.redhat.com/show_bug.cgi?id=1751861 . I frequently get logs like this: and find usbguard not running and my external keyboard/mouse not working after I leave my machine idling for over an hour. |
|
I can confirm what @rathann is seeing. |
|
If I understand the code correctly, the big issue is that when this error happens, it doesn't affect the exit code of the process, which will always return success: Lines 196 to 197 in 4957d2d
And it seems that the systemd service is configured to only restart on failures: Line 25 in 4957d2d
So it means that once this error happens, the systemd service will finish with success and not be restarted. I guess that as a workaround, I can |
|
On my fedora 31 usbguard is basically useless as it keeps exiting. Is someone actually looking into this? |
There is an update, also for Fedora 31 but I now instead see issue #279 which breaks usbguard completely in my case. |
|
From upstream point of view this seems to be fixed. |
Under some circumstances sigwaitinfo (and other syscalls) can get an EINTR which generally means the program should repeat the previous syscall because of an interrupt, so it might make sense to call sigwaitinfo again.
However, this might be intended behavior or better left as is if usbguard were to lose track of uevents or other system state changes having it close on EINTR would give it the opportunity for the daemon to be respawned and pickup the current state instead of resuming with the old state. I am not convinced the state would get out of sync in practice,
You can trigger this behavior by the following:
sudo kill -SIGSTOP ${USBGUARD_PID}; sudo kill -SIGCONT ${USBGUARD_PID}
It isn't necessary to send a SIGSTOP though, an EINTR can happen for a variety of reasons, this is just an easy way to trigger the behavior. Ideally, if you want to handle EINTR, you would need to do it for a good number of the syscalls besides just sigwaitinfo.
The text was updated successfully, but these errors were encountered: