udev: open control and netlink sockets before daemonization
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 8 Jan 2019 21:41:16 +0000 (22:41 +0100)
committerMartin Pitt <mpitt@debian.org>
Sun, 27 Jan 2019 21:33:07 +0000 (21:33 +0000)
commit6249ef7274a3d9e3414b3b17347e45b9fcd777c1
tree7152ed653b9621df3d96d11715bf91c30995de97
parent608fd21bbedb614ff97c66bf6c211a03fdb537f9
udev: open control and netlink sockets before daemonization

MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

c4b69e990f962128cc6975e36e91e9ad838fa2c4 effectively moved the initalization of socket.
Before that commit:
run → listen_fds → udev_ctrl_new → udev_ctrl_new_from_fd → socket()
After:
run → main_loop → manager_new → udev_ctrl_new_from_fd → socket()

The problem is that main_loop was called after daemonization. Move manager_new
out of main_loop and before daemonization.

Fixes #11314 (hopefully ;)).

v2: Yu Watanabe
sd_event is initialized in main_loop().

(cherry picked from commit b5af8c8cdf5fc7cc5d4108460270728375eb7fc4)
(cherry picked from commit 6b59b44b87568fe5f8362018f47d440b1e6681dd)

Gbp-Pq: Name udev-open-control-and-netlink-sockets-before-daemonizatio.patch
src/udev/udevd.c