mirror of
https://github.com/systemd/systemd.git
synced 2024-12-23 21:35:11 +03:00
networkd: use Type=notify
Also start earlier during boot.
This commit is contained in:
parent
bfe76ec3ce
commit
4b6141c424
@ -35,28 +35,37 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
if (argc != 1) {
|
||||
log_error("This program takes no arguments.");
|
||||
return EXIT_FAILURE;
|
||||
r = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
r = manager_new(&m);
|
||||
if (r < 0)
|
||||
return EXIT_FAILURE;
|
||||
goto out;
|
||||
|
||||
r = manager_udev_listen(m);
|
||||
if (r < 0)
|
||||
return EXIT_FAILURE;
|
||||
goto out;
|
||||
|
||||
r = manager_udev_enumerate_links(m);
|
||||
if (r < 0)
|
||||
return EXIT_FAILURE;
|
||||
goto out;
|
||||
|
||||
r = manager_rtnl_listen(m);
|
||||
if (r < 0)
|
||||
return EXIT_FAILURE;
|
||||
goto out;
|
||||
|
||||
sd_notify(false,
|
||||
"READY=1\n"
|
||||
"STATUS=Processing requests...");
|
||||
|
||||
r = sd_event_loop(m->event);
|
||||
if (r < 0)
|
||||
return EXIT_FAILURE;
|
||||
goto out;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
out:
|
||||
sd_notify(false,
|
||||
"STATUS=Shutting down...");
|
||||
|
||||
return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
|
||||
}
|
||||
|
@ -9,11 +9,11 @@
|
||||
Description=Network Service
|
||||
Documentation=man:systemd-networkd.service(8)
|
||||
DefaultDependencies=no
|
||||
After=sysinit.target
|
||||
Before=network.target
|
||||
Wants=network.target
|
||||
|
||||
[Service]
|
||||
Type=notify
|
||||
Restart=always
|
||||
RestartSec=0
|
||||
ExecStart=@rootlibexecdir@/systemd-networkd
|
||||
|
Loading…
Reference in New Issue
Block a user