networkd-wait-online.c revision 7de12ae764e73730df0658f9fb04bcf42add48e2
020d59000f86b3d98be763eaee6a2671f0427e46Tom Gundersen This file is part of systemd.
020d59000f86b3d98be763eaee6a2671f0427e46Tom Gundersen Copyright 2013 Tom Gundersen <teg@jklm.no>
020d59000f86b3d98be763eaee6a2671f0427e46Tom Gundersen systemd is free software; you can redistribute it and/or modify it
020d59000f86b3d98be763eaee6a2671f0427e46Tom Gundersen under the terms of the GNU Lesser General Public License as published by
020d59000f86b3d98be763eaee6a2671f0427e46Tom Gundersen the Free Software Foundation; either version 2.1 of the License, or
020d59000f86b3d98be763eaee6a2671f0427e46Tom Gundersen (at your option) any later version.
020d59000f86b3d98be763eaee6a2671f0427e46Tom Gundersen systemd is distributed in the hope that it will be useful, but
020d59000f86b3d98be763eaee6a2671f0427e46Tom Gundersen WITHOUT ANY WARRANTY; without even the implied warranty of
020d59000f86b3d98be763eaee6a2671f0427e46Tom Gundersen MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
020d59000f86b3d98be763eaee6a2671f0427e46Tom Gundersen Lesser General Public License for more details.
020d59000f86b3d98be763eaee6a2671f0427e46Tom Gundersen You should have received a copy of the GNU Lesser General Public License
020d59000f86b3d98be763eaee6a2671f0427e46Tom Gundersen along with systemd; If not, see <http://www.gnu.org/licenses/>.
cef8b0735831b2bfeaf21d8a245d8024c3de816aTom Gundersenstatic bool arg_quiet = false;
cef8b0735831b2bfeaf21d8a245d8024c3de816aTom Gundersenstatic int help(void) {
cef8b0735831b2bfeaf21d8a245d8024c3de816aTom Gundersen "Block until network is configured.\n\n"
cef8b0735831b2bfeaf21d8a245d8024c3de816aTom Gundersen " -h --help Show this help\n"
cef8b0735831b2bfeaf21d8a245d8024c3de816aTom Gundersen " --version Print version string\n"
cef8b0735831b2bfeaf21d8a245d8024c3de816aTom Gundersen " -q --quiet Do not show status information\n"
cef8b0735831b2bfeaf21d8a245d8024c3de816aTom Gundersen " -i --interface=INTERFACE Block until at least these interfaces have appeared\n",
cef8b0735831b2bfeaf21d8a245d8024c3de816aTom Gundersenstatic int parse_argv(int argc, char *argv[]) {
cef8b0735831b2bfeaf21d8a245d8024c3de816aTom Gundersen { "version", no_argument, NULL, ARG_VERSION },
cef8b0735831b2bfeaf21d8a245d8024c3de816aTom Gundersen { "interface", required_argument, NULL, 'i' },
cef8b0735831b2bfeaf21d8a245d8024c3de816aTom Gundersen while ((c = getopt_long(argc, argv, "+hq", options, NULL)) >= 0) {
7de12ae764e73730df0658f9fb04bcf42add48e2Tom Gundersen assert_se(sigprocmask_many(SIG_BLOCK, SIGTERM, SIGINT, -1) == 0);
7de12ae764e73730df0658f9fb04bcf42add48e2Tom Gundersen log_error("Could not create manager: %s", strerror(-r));
b6b8adbff4b1a67a2fffc2c225f1b083d9e4a69eTom Gundersen "STATUS=Waiting for network connections...");
020d59000f86b3d98be763eaee6a2671f0427e46Tom Gundersen log_error("Event loop failed: %s", strerror(-r));
7de12ae764e73730df0658f9fb04bcf42add48e2Tom Gundersen sd_notify(false, "STATUS=All interfaces configured...");