agent/app/agent_unix.go
func (agent *ecsAgent) startUdevWatcher(state dockerstate.TaskEngineState, stateChangeEvents chan<- statechange.Event) error {
	seelog.Debug("Setting up ENI Watcher")
	udevMonitor, err := udevwrapper.New()
	if err != nil {
		return errors.Wrapf(err, "unable to create udev monitor")
	}
	// Create Watcher
	eniWatcher := watcher.New(agent.ctx, agent.mac, udevMonitor, state, stateChangeEvents)
	if err := eniWatcher.Init(); err != nil {
		return errors.Wrapf(err, "unable to initialize eni watcher")
	}
	go eniWatcher.Start()
	return nil
}
func (agent *ecsAgent) startUdevWatcher(state dockerstate.TaskEngineState, stateChangeEvents chan<- statechange.Event) error {
	seelog.Debug("Setting up ENI Watcher")
	udevMonitor, err := udevwrapper.New()
	if err != nil {
		return errors.Wrapf(err, "unable to create udev monitor")
	}
	// Create Watcher
	eniWatcher := watcher.New(agent.ctx, agent.mac, udevMonitor, state, stateChangeEvents)
	if err := eniWatcher.Init(); err != nil {
		return errors.Wrapf(err, "unable to initialize eni watcher")
	}
	go eniWatcher.Start()
	return nil
}
// startUdevWatcher starts the udev monitor and the watcher for receiving
// notifications from the monitor