diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-02-20 22:25:43 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2016-02-21 20:40:57 +0100 |
commit | 58fb367825b7ce72b466e24c422dd3eb6d5554f4 (patch) | |
tree | 0145a7366cff25ee0749b811c785f66b39305e3f | |
parent | 33d5013db09729d3453d60a1a194016e27ef4fab (diff) |
networkctl: print a nice warning when networkd isn't running
-rw-r--r-- | src/network/networkctl.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/network/networkctl.c b/src/network/networkctl.c index b7b3b51325..27a758152e 100644 --- a/src/network/networkctl.c +++ b/src/network/networkctl.c @@ -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: |