- /* trigger timout to interrupt blocking syscalls */
- alarm(ALARM_TIMEOUT);
-
- /* initialize udev database */
- if (udevdb_init(UDEVDB_DEFAULT) != 0)
- info("error: unable to initialize database, continuing without database");
-
- switch(act_type) {
- case UDEVSTART:
- dbg("udevstart");
- namedev_init();
- udev_sleep = 0;
- retval = udev_start();
- break;
- case ADD:
- dbg("udev add");
- namedev_init();
- retval = udev_add_device(devpath, subsystem, NOFAKE);
- break;
- case REMOVE:
- dbg("udev remove");
- retval = udev_remove_device(devpath, subsystem);
+ retval = udev_process_event(&rules, &udev);
+
+ if (!retval && udev_run && !list_empty(&udev.run_list)) {
+ struct name_entry *name_loop;
+
+ dbg("executing run list");
+ list_for_each_entry(name_loop, &udev.run_list, node) {
+ if (strncmp(name_loop->name, "socket:", strlen("socket:")) == 0)
+ pass_env_to_socket(&name_loop->name[strlen("socket:")], devpath, action);
+ else
+ run_program(name_loop->name, udev.subsystem, NULL, 0, NULL, (udev_log_priority >= LOG_INFO));
+ }