chiark / gitweb /
udev: timeout - increase timeout
[elogind.git] / src / udev / udevd.c
index e72c5b231e004aec76e9b16461acb8af6dfea094..a7f8cbdf5b91cc0d35332f3b1be5526df16e466e 100644 (file)
@@ -48,6 +48,7 @@
 
 #include "udev.h"
 #include "udev-util.h"
+#include "rtnl-util.h"
 #include "sd-daemon.h"
 #include "cgroup-util.h"
 #include "dev-setup.h"
@@ -73,7 +74,7 @@ static bool reload;
 static int children;
 static int children_max;
 static int exec_delay;
-static usec_t event_timeout_usec = 60 * USEC_PER_SEC;
+static usec_t event_timeout_usec = 180 * USEC_PER_SEC;
 static sigset_t sigmask_orig;
 static UDEV_LIST(event_list);
 static UDEV_LIST(worker_list);
@@ -200,6 +201,7 @@ static void worker_new(struct event *event) {
         case 0: {
                 struct udev_device *dev = NULL;
                 int fd_monitor;
+                _cleanup_rtnl_unref_ sd_rtnl *rtnl = NULL;
                 struct epoll_event ep_signal, ep_monitor;
                 sigset_t mask;
                 int rc = EXIT_SUCCESS;
@@ -301,11 +303,17 @@ static void worker_new(struct event *event) {
                                 }
                         }
 
+                        /* needed for renaming netifs */
+                        udev_event->rtnl = rtnl;
+
                         /* apply rules, create node, symlinks */
                         udev_event_execute_rules(udev_event, event_timeout_usec, rules, &sigmask_orig);
 
                         udev_event_execute_run(udev_event, event_timeout_usec, &sigmask_orig);
 
+                        /* in case rtnl was initialized */
+                        rtnl = sd_rtnl_ref(udev_event->rtnl);
+
                         /* apply/restore inotify watch */
                         if (udev_event->inotify_watch) {
                                 udev_watch_begin(udev, dev);
@@ -1192,7 +1200,7 @@ int main(int argc, char *argv[]) {
                 sd_notify(1, "READY=1");
         }
 
-        print_kmsg("starting version " VERSION "\n");
+        log_info("starting version " VERSION "\n");
 
         if (!debug) {
                 int fd;