mirror of
https://github.com/systemd/systemd.git
synced 2025-03-21 02:50:18 +03:00
Merge pull request #13582 from yuwata/udevadm-reload
udevadm: use 'udevadm control' to reload udevd
This commit is contained in:
commit
5a4717fe8e
@ -76,6 +76,7 @@ int udev_ctrl_new_from_fd(struct udev_ctrl **ret, int fd) {
|
||||
*uctrl = (struct udev_ctrl) {
|
||||
.n_ref = 1,
|
||||
.sock = fd >= 0 ? fd : TAKE_FD(sock),
|
||||
.sock_connect = -1,
|
||||
.bound = fd >= 0,
|
||||
};
|
||||
|
||||
@ -394,14 +395,13 @@ int udev_ctrl_wait(struct udev_ctrl *uctrl, usec_t timeout) {
|
||||
(void) sd_event_source_set_description(source_io, "udev-ctrl-wait-io");
|
||||
|
||||
if (timeout != USEC_INFINITY) {
|
||||
usec_t usec;
|
||||
|
||||
usec = now(clock_boottime_or_monotonic()) + timeout;
|
||||
r = sd_event_add_time(uctrl->event, &source_timeout, clock_boottime_or_monotonic(), usec, 0, NULL, INT_TO_PTR(-ETIMEDOUT));
|
||||
r = sd_event_add_time(uctrl->event, &source_timeout, clock_boottime_or_monotonic(),
|
||||
usec_add(now(clock_boottime_or_monotonic()), timeout),
|
||||
0, NULL, INT_TO_PTR(-ETIMEDOUT));
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
(void) sd_event_source_set_description(source_timeout, "udev-ctrl-wait-io");
|
||||
(void) sd_event_source_set_description(source_timeout, "udev-ctrl-wait-timeout");
|
||||
}
|
||||
|
||||
return sd_event_loop(uctrl->event);
|
||||
|
@ -23,6 +23,7 @@ Sockets=systemd-udevd-control.socket systemd-udevd-kernel.socket
|
||||
Restart=always
|
||||
RestartSec=0
|
||||
ExecStart=@rootlibexecdir@/systemd-udevd
|
||||
ExecReload=@rootbindir@/udevadm control --reload --timeout 0
|
||||
KillMode=mixed
|
||||
WatchdogSec=3min
|
||||
TasksMax=infinity
|
||||
|
Loading…
x
Reference in New Issue
Block a user