← Back to team overview

touch-packages team mailing list archive

[Bug 1412543] Re: udev bridge fails to get events from kernel

 

There is indeed a race in the upstart job, which makes it unable to
receive the kernel events. It works every time now after changing the
upstart job to start on 'started' instead of 'starting' udev.

Looking at the libudev code, this is what is currently happening:
"""
struct udev_monitor *udev_monitor_new_from_netlink_fd(struct udev *udev, const char *name, int fd) 
{
        struct udev_monitor *udev_monitor;
        unsigned int group;

        if (udev == NULL)
                return NULL;

        if (name == NULL)
                group = UDEV_MONITOR_NONE;
        else if (streq(name, "udev")) {
                /*  
                 * We do not support subscribing to uevents if no instance of
                 * udev is running. Uevents would otherwise broadcast the
                 * processing data of the host into containers, which is not
                 * desired.
                 *
                 * Containers will currently not get any udev uevents, until
                 * a supporting infrastructure is available.
                 *
                 * We do not set a netlink multicast group here, so the socket
                 * will not receive any messages.
                 */
                if (access("/run/udev/control", F_OK) < 0 && !udev_has_devtmpfs(udev)) {
                        log_debug("the udev service seems not to be active, disable the monitor");
                        group = UDEV_MONITOR_NONE;
                } else
                        group = UDEV_MONITOR_UDEV;
        } else if (streq(name, "kernel"))
                group = UDEV_MONITOR_KERNEL;
        else
                return NULL;
....
"""

Added some debug lines in the upstart-udev-bridge job and
/run/udev/control is not necessarily available when this job starts (I'd
guess it only happens on ubuntu-touch, since we start udev a bit later
than the desktop).

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to upstart in Ubuntu.
https://bugs.launchpad.net/bugs/1412543

Title:
  udev bridge fails to get events from kernel

Status in upstart package in Ubuntu:
  New

Bug description:
  current build number: 70
  device name: mako
  channel: ubuntu-touch/vivid-proposed
  last update: 2015-01-19 14:11:13
  version version: 70
  version ubuntu: 20150119
  version device: 20150116
  version custom: 20150119

  Noticed that sometimes upstart is not receiving kernel events, which
  caused bad side effects at the usb event logic we have in ubuntu
  touch.

  Basically I noticed that /etc/init/android-usb-state.conf fails to
  send the connected/disconnected events during some reboots when
  testing MTP. Looking a bit further, I saw that not only these events
  are missing, but every udev related ones.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/1412543/+subscriptions


References