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)
committerMichael Biebl <biebl@debian.org>
Sat, 12 Jan 2019 20:49:44 +0000 (20:49 +0000)
commita082a40ba0065f94663feb9579cd28fc25aad231
treec949ae1822fb36f5926690fabf542cdcfd36a107
parent4bb8fab6ab226a68c7b5375d67bef8ce02c6b99f
udev: open control and netlink sockets before daemonization

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