- char *argv[] = { "ubusd", NULL, ubus_socket, NULL };
-
- if (ubus_proc.pending) {
- DPRINTF("Killing existing ubus instance, pid=%d\n", (int) ubus_proc.pid);
- kill(ubus_proc.pid, SIGKILL);
- uloop_process_delete(&ubus_proc);
- }
-
- if (ubus_socket)
- argv[1] = "-s";
-
- ubus_proc.pid = fork();
- if (!ubus_proc.pid) {
- execvp(argv[0], argv);
- exit(-1);
- }
-
- if (ubus_proc.pid <= 0) {
- DPRINTF("Failed to start new ubus instance\n");
- return;
- }
-
- DPRINTF("Launched new ubus instance, pid=%d\n", (int) ubus_proc.pid);
- uloop_process_add(&ubus_proc);
+ ubus_timer.cb = ubus_reconnect_cb;
+ uloop_timeout_set(&ubus_timer, 2000);