diff --git a/src/udev/udevd.c b/src/udev/udevd.c index 8c690357b8..1e90b94f5c 100644 --- a/src/udev/udevd.c +++ b/src/udev/udevd.c @@ -760,10 +760,6 @@ static int event_run(Event *event) { /* Re-enable the debug message for the next batch of events */ log_children_max_reached = true; - /* fork with up-to-date SELinux label database, so the child inherits the up-to-date db - * and, until the next SELinux policy changes, we safe further reloads in future children */ - mac_selinux_maybe_reload(); - /* start new worker and pass initial device */ r = worker_spawn(manager, event); if (r < 0) @@ -945,6 +941,10 @@ static int event_queue_start(Manager *manager) { return log_warning_errno(r, "Failed to read udev rules: %m"); } + /* fork with up-to-date SELinux label database, so the child inherits the up-to-date db + * and, until the next SELinux policy changes, we safe further reloads in future children */ + mac_selinux_maybe_reload(); + LIST_FOREACH(event, event, manager->events) { if (event->state != EVENT_QUEUED) continue;