mirror of
https://github.com/systemd/systemd.git
synced 2024-12-23 21:35:11 +03:00
remove UDEV_RUN environment variable
It handles only RUN but not IMPORT and PROGRAM. There is no sane way to suppress program execution. Most important programs run with IMPORT these days. Also events can no longer suppressed with the libudev netlink messages, so UDEV_RUN does nothing useful and is just inconsistent.
This commit is contained in:
parent
1d67ec16c4
commit
f46d2e54a8
@ -28,9 +28,9 @@ CLEANFILES =
|
||||
# ------------------------------------------------------------------------------
|
||||
# libudev
|
||||
# ------------------------------------------------------------------------------
|
||||
LIBUDEV_CURRENT=5
|
||||
LIBUDEV_REVISION=2
|
||||
LIBUDEV_AGE=5
|
||||
LIBUDEV_CURRENT=6
|
||||
LIBUDEV_REVISION=0
|
||||
LIBUDEV_AGE=6
|
||||
|
||||
SUBDIRS += libudev/docs
|
||||
|
||||
|
@ -59,7 +59,6 @@ void udev_log(struct udev *udev,
|
||||
const char *format, ...)
|
||||
__attribute__((format(printf, 6, 7)));
|
||||
const char *udev_get_rules_path(struct udev *udev);
|
||||
int udev_get_run(struct udev *udev);
|
||||
struct udev_list_entry *udev_add_property(struct udev *udev, const char *key, const char *value);
|
||||
struct udev_list_entry *udev_get_properties_list_entry(struct udev *udev);
|
||||
|
||||
|
@ -45,7 +45,6 @@ struct udev {
|
||||
char *rules_path;
|
||||
struct udev_list_node properties_list;
|
||||
int log_priority;
|
||||
int run;
|
||||
};
|
||||
|
||||
void udev_log(struct udev *udev,
|
||||
@ -122,7 +121,6 @@ struct udev *udev_new(void)
|
||||
udev->log_fn = log_stderr;
|
||||
udev->log_priority = LOG_ERR;
|
||||
udev_list_init(&udev->properties_list);
|
||||
udev->run = 1;
|
||||
udev->dev_path = strdup("/dev");
|
||||
udev->sys_path = strdup("/sys");
|
||||
config_file = strdup(SYSCONFDIR "/udev/udev.conf");
|
||||
@ -140,10 +138,6 @@ struct udev *udev_new(void)
|
||||
udev_add_property(udev, "SYSFS_PATH", udev->sys_path);
|
||||
}
|
||||
|
||||
env = getenv("UDEV_RUN");
|
||||
if (env != NULL && strcmp(env, "0") == 0)
|
||||
udev->run = 0;
|
||||
|
||||
env = getenv("UDEV_CONFIG_FILE");
|
||||
if (env != NULL) {
|
||||
free(config_file);
|
||||
@ -359,11 +353,6 @@ const char *udev_get_rules_path(struct udev *udev)
|
||||
return udev->rules_path;
|
||||
}
|
||||
|
||||
int udev_get_run(struct udev *udev)
|
||||
{
|
||||
return udev->run;
|
||||
}
|
||||
|
||||
/**
|
||||
* udev_get_sys_path:
|
||||
* @udev: udev library context
|
||||
|
@ -108,7 +108,7 @@ int main(int argc, char *argv[])
|
||||
if (udev_device_get_event_timeout(dev) >= 0)
|
||||
alarm(udev_device_get_event_timeout(dev));
|
||||
|
||||
if (err == 0 && udev_get_run(udev))
|
||||
if (err == 0)
|
||||
udev_event_execute_run(event, NULL);
|
||||
|
||||
udev_event_unref(event);
|
||||
|
@ -119,14 +119,13 @@ int udevadm_test(struct udev *udev, int argc, char *argv[])
|
||||
udev_list_entry_foreach(entry, udev_device_get_properties_list_entry(dev))
|
||||
info(udev, "%s=%s\n", udev_list_entry_get_name(entry), udev_list_entry_get_value(entry));
|
||||
|
||||
if (err == 0 && udev_get_run(udev)) {
|
||||
if (err == 0)
|
||||
udev_list_entry_foreach(entry, udev_list_get_entry(&event->run_list)) {
|
||||
char program[UTIL_PATH_SIZE];
|
||||
|
||||
udev_event_apply_format(event, udev_list_entry_get_name(entry), program, sizeof(program));
|
||||
info(udev, "run: '%s'\n", program);
|
||||
}
|
||||
}
|
||||
udev_event_unref(event);
|
||||
udev_device_unref(dev);
|
||||
exit:
|
||||
|
@ -292,12 +292,9 @@ static void worker_new(struct event *event)
|
||||
if (udev_device_get_event_timeout(dev) >= 0)
|
||||
alarm(udev_device_get_event_timeout(dev));
|
||||
|
||||
/* execute RUN= */
|
||||
if (err == 0 && udev_get_run(udev_event->udev))
|
||||
failed = udev_event_execute_run(udev_event,
|
||||
&orig_sigmask);
|
||||
if (err == 0)
|
||||
failed = udev_event_execute_run(udev_event, &orig_sigmask);
|
||||
|
||||
/* reset alarm */
|
||||
alarm(0);
|
||||
|
||||
/* apply/restore inotify watch */
|
||||
@ -309,7 +306,7 @@ static void worker_new(struct event *event)
|
||||
/* send processed event back to libudev listeners */
|
||||
udev_monitor_send_device(worker_monitor, NULL, dev);
|
||||
|
||||
/* send back the result of the event execution */
|
||||
/* send udevd the result of the event execution */
|
||||
if (err != 0)
|
||||
msg.exitcode = err;
|
||||
else if (failed != 0)
|
||||
|
Loading…
Reference in New Issue
Block a user