summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS10
-rw-r--r--rules/rules.d/80-drivers.rules2
-rw-r--r--udev/udev-event.c2
-rw-r--r--udev/udev-rules.c2
-rw-r--r--udev/udev.xml5
-rw-r--r--udev/udevadm-trigger.c4
-rw-r--r--udev/udevd.c12
7 files changed, 24 insertions, 13 deletions
diff --git a/NEWS b/NEWS
index b36ace5c05..0f41c18bbe 100644
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,15 @@
udev 146
========
-New keymaps, new modem, hid2hci updated.
+Bugfixes.
+
+The udevadm trigger "--retry-failed" option, which is replaced since quite
+a while by "--type=failed" is removed.
+The failed tracking was not working at all for a few releases. The RUN
+option "ignore_error" is replaces by a "record_failed" option, and the
+default is not to track any failing RUN executions.
+
+New keymaps, new modem, hid2hci updated.
udev 145
========
diff --git a/rules/rules.d/80-drivers.rules b/rules/rules.d/80-drivers.rules
index 63409cc01f..d0485e13c4 100644
--- a/rules/rules.d/80-drivers.rules
+++ b/rules/rules.d/80-drivers.rules
@@ -2,7 +2,7 @@
ACTION!="add", GOTO="drivers_end"
-DRIVER!="?*", ENV{MODALIAS}=="?*", RUN{ignore_error}+="/sbin/modprobe -b $env{MODALIAS}"
+DRIVER!="?*", ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe -b $env{MODALIAS}"
SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="SD", RUN+="/sbin/modprobe -b tifm_sd"
SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="MS", RUN+="/sbin/modprobe -b tifm_ms"
SUBSYSTEM=="memstick", RUN+="/sbin/modprobe -b --all ms_block mspro_block"
diff --git a/udev/udev-event.c b/udev/udev-event.c
index 5716afef7a..6a8bb44cf4 100644
--- a/udev/udev-event.c
+++ b/udev/udev-event.c
@@ -741,7 +741,7 @@ int udev_event_execute_run(struct udev_event *event)
udev_event_apply_format(event, cmd, program, sizeof(program));
envp = udev_device_get_properties_envp(event->dev);
if (util_run_program(event->udev, program, envp, NULL, 0, NULL) != 0) {
- if (!udev_list_entry_get_flag(list_entry))
+ if (udev_list_entry_get_flag(list_entry))
err = -1;
}
}
diff --git a/udev/udev-rules.c b/udev/udev-rules.c
index a174d5db40..5f6ed06c9c 100644
--- a/udev/udev-rules.c
+++ b/udev/udev-rules.c
@@ -1379,7 +1379,7 @@ static int add_rule(struct udev_rules *rules, char *line,
int flag = 0;
attr = get_key_attribute(rules->udev, key + sizeof("RUN")-1);
- if (attr != NULL && strstr(attr, "ignore_error"))
+ if (attr != NULL && strstr(attr, "record_failed"))
flag = 1;
rule_add_key(&rule_tmp, TK_A_RUN, op, value, &flag);
continue;
diff --git a/udev/udev.xml b/udev/udev.xml
index 934fe628ae..5aa6c38da4 100644
--- a/udev/udev.xml
+++ b/udev/udev.xml
@@ -335,7 +335,10 @@
device. This can only be used for very short running tasks. Running an
event process for a long period of time may block all further events for
this or a dependent device. Long running tasks need to be immediately
- detached from the event process itself.</para>
+ detached from the event process itself. If the option
+ <option>RUN{<replaceable>record_failed</replaceable>}</option> is specified,
+ and the executed program returns non-zero, the event will be marked as failed
+ for a possible later handling.</para>
<para>If the specified string starts with
<option>socket:<replaceable>path</replaceable></option>, all current event
values will be passed to the specified socket, as a message in the same
diff --git a/udev/udevadm-trigger.c b/udev/udevadm-trigger.c
index a97feb79b3..5cd4acd6ed 100644
--- a/udev/udevadm-trigger.c
+++ b/udev/udevadm-trigger.c
@@ -95,7 +95,6 @@ int udevadm_trigger(struct udev *udev, int argc, char *argv[])
{ "verbose", no_argument, NULL, 'v' },
{ "dry-run", no_argument, NULL, 'n' },
{ "type", required_argument, NULL, 't' },
- { "retry-failed", no_argument, NULL, 'F' },
{ "action", required_argument, NULL, 'c' },
{ "subsystem-match", required_argument, NULL, 's' },
{ "subsystem-nomatch", required_argument, NULL, 'S' },
@@ -153,9 +152,6 @@ int udevadm_trigger(struct udev *udev, int argc, char *argv[])
goto exit;
}
break;
- case 'F':
- device_type = TYPE_FAILED;
- break;
case 'c':
action = optarg;
break;
diff --git a/udev/udevd.c b/udev/udevd.c
index 69d509ce91..4024460d4b 100644
--- a/udev/udevd.c
+++ b/udev/udevd.c
@@ -165,7 +165,7 @@ static void event_queue_delete(struct event *event)
udev_list_node_remove(&event->node);
/* mark as failed, if "add" event returns non-zero */
- if (event->exitcode && strcmp(udev_device_get_action(event->dev), "add") == 0)
+ if (event->exitcode != 0 && strcmp(udev_device_get_action(event->dev), "add") == 0)
udev_queue_export_device_failed(udev_queue_export, event->dev);
else
udev_queue_export_device_finished(udev_queue_export, event->dev);
@@ -271,8 +271,9 @@ static void worker_new(struct event *event)
do {
struct udev_event *udev_event;
- struct worker_message msg;
+ struct worker_message msg = {};
int err;
+ int failed = 0;
info(event->udev, "seq %llu running\n", udev_device_get_seqnum(dev));
udev_event = udev_event_new(dev);
@@ -291,7 +292,7 @@ static void worker_new(struct event *event)
/* execute RUN= */
if (err == 0 && !udev_event->ignore_device && udev_get_run(udev_event->udev))
- udev_event_execute_run(udev_event);
+ failed = udev_event_execute_run(udev_event);
/* reset alarm */
alarm(0);
@@ -306,7 +307,10 @@ static void worker_new(struct event *event)
udev_monitor_send_device(worker_monitor, NULL, dev);
/* send back the result of the event execution */
- msg.exitcode = err;
+ if (err != 0)
+ msg.exitcode = err;
+ else if (failed != 0)
+ msg.exitcode = failed;
msg.pid = getpid();
send(worker_watch[WRITE_END], &msg, sizeof(struct worker_message), 0);