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
cmd/snap-bootstrap: no error when not input devices are found #8490
cmd/snap-bootstrap: no error when not input devices are found #8490
Conversation
…dev/input Make the recovery chooser trigger service depend on /dev/input being non-empty. This will make systemd skip the service when there are no input devices. Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
d402a9b
to
b7a1b1d
Compare
There is no way to trigger the recovery when there are no matching input devices available in the system. This is not an error, so the exit status should still be 0. Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
b7a1b1d
to
706cac6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, with one nitpick.
logger.Noticef("trigger not detected") | ||
return nil | ||
case triggerwatch.ErrNoMatchingInputDevices: | ||
logger.Noticef("no matching input devices") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps you could log err string (also above) instead of explicit message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logger is already set up to log to stderr or whichever other place that is correct in this context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, maybe I wasn't clear, what I meant is:
logger.Noticef("%s", err)
Do not error out when no matching input devices are present. Also, tweak the snapd.recovery-chooser-trigger.service to start only when there are input devices at
/dev/input/event*
.Related: https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1870212
cc @xnox