mirror of
https://github.com/systemd/systemd.git
synced 2024-11-04 13:51:24 +03:00
networkctl: print a nice warning when networkd isn't running
This commit is contained in:
parent
33d5013db0
commit
58fb367825
@ -1064,6 +1064,14 @@ static int networkctl_main(int argc, char *argv[]) {
|
||||
return dispatch_verb(argc, argv, verbs, NULL);
|
||||
}
|
||||
|
||||
static void warn_networkd_missing(void) {
|
||||
|
||||
if (access("/run/systemd/netif/state", F_OK) >= 0)
|
||||
return;
|
||||
|
||||
fprintf(stderr, "WARNING: systemd-networkd is not running, output will be incomplete.\n\n");
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
int r;
|
||||
|
||||
@ -1074,6 +1082,8 @@ int main(int argc, char* argv[]) {
|
||||
if (r <= 0)
|
||||
goto finish;
|
||||
|
||||
warn_networkd_missing();
|
||||
|
||||
r = networkctl_main(argc, argv);
|
||||
|
||||
finish:
|
||||
|
Loading…
Reference in New Issue
Block a user