File: nm-online.xml

package info (click to toggle)
network-manager 1.54.3-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 71,432 kB
  • sloc: ansic: 483,661; python: 11,632; xml: 8,546; sh: 5,552; perl: 596; cpp: 178; javascript: 130; ruby: 107; makefile: 64; lisp: 22
file content (180 lines) | stat: -rw-r--r-- 6,920 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<?xml version='1.0'?>
<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % entities SYSTEM "common.ent" >
%entities;
]>

<!--
  SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later

  nm-online(1) manual page

  Copyright 2010 - 2016 Red Hat, Inc.
-->

<refentry id='nm-online'>

  <refentryinfo>
    <title>nm-online</title>
    <author>NetworkManager developers</author>
  </refentryinfo>

  <refmeta>
    <refentrytitle>nm-online</refentrytitle>
    <manvolnum>1</manvolnum>
    <refmiscinfo class="source">NetworkManager</refmiscinfo>
    <refmiscinfo class="manual">General Commands Manual</refmiscinfo>
    <refmiscinfo class="version">&NM_VERSION;</refmiscinfo>
  </refmeta>

  <refnamediv>
    <refname>nm-online</refname>
    <refpurpose>ask NetworkManager whether the network is connected</refpurpose>
  </refnamediv>

  <refsynopsisdiv id='synopsis'>
    <cmdsynopsis>
      <command>nm-online</command>
      <arg choice="opt" rep="repeat"><replaceable>OPTIONS</replaceable></arg>
    </cmdsynopsis>
  </refsynopsisdiv>

  <refsect1 id='description'><title>Description</title>
    <para><command>nm-online</command> is a utility to find out whether we are
    online. It is done by asking NetworkManager about its status. When run,
    <command>nm-online</command> waits until NetworkManager reports an active
    connection, or specified timeout expires. On exit, the returned status code
    should be checked (see the return codes below).</para>

    <para>This tool is not very useful to call directly. It is however used by
    <literal>NetworkManager-wait-online.service</literal> with
    <literal>--wait-for-startup</literal> argument
      (see <link linkend='NetworkManager-wait-online.service'><citerefentry><refentrytitle>NetworkManager-wait-online.service</refentrytitle><manvolnum>8</manvolnum></citerefentry></link>).
    </para>

    <para>By default, connections have the <literal>ipv4.may-fail</literal> and
    <literal>ipv6.may-fail</literal> properties set to <literal>yes</literal>;
    this means that NetworkManager waits for one of the two address families to
    complete configuration before considering the connection activated. If you
    need a specific address family configured before
    <literal>network-online.target</literal> is reached, set the corresponding
    <literal>may-fail</literal> property to <literal>no</literal>.</para>
  </refsect1>

  <refsect1 id='options'><title>Options</title>
    <variablelist>
      <varlistentry>
        <term><group choice='plain'>
          <arg choice='plain'><option>-h</option></arg>
          <arg choice='plain'><option>--help</option></arg>
        </group></term>

        <listitem>
          <para>Print help information.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><group choice='plain'>
          <arg choice='plain'><option>-q</option></arg>
          <arg choice='plain'><option>--quiet</option></arg>
        </group></term>

        <listitem>
          <para>Don't print anything.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><group choice='plain'>
          <arg choice='plain'><option>-s</option></arg>
          <arg choice='plain'><option>--wait-for-startup</option></arg>
        </group></term>

        <listitem>
          <para>Wait for NetworkManager startup to complete, rather than waiting for
          network connectivity specifically. Startup is considered complete once
          NetworkManager has activated (or attempted to activate) every auto-activate
          connection which is available given the current network state. This corresponds
          to the moment when NetworkManager logs <literal>"startup complete"</literal>.
          This mode is generally only useful at boot time. After startup has completed,
          <command>nm-online -s</command> will just return immediately, regardless of the
          current network state.</para>
          <para>There are various ways to affect when startup complete is reached.
          For details see
          <link linkend='NetworkManager-wait-online.service'><citerefentry><refentrytitle>NetworkManager-wait-online.service</refentrytitle><manvolnum>8</manvolnum></citerefentry></link>.
          </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>
          <group choice='plain'>
            <arg choice='plain'><option>-t</option></arg>
            <arg choice='plain'><option>--timeout</option></arg>
          </group>
          <arg choice='plain'><replaceable>seconds</replaceable></arg>
        </term>

        <listitem>
          <para>Time to wait for a connection, in seconds. If the option is not provided,
          the environment variable <literal>NM_ONLINE_TIMEOUT</literal> is honored.
          The default timeout is 30 seconds.</para>
        </listitem>
      </varlistentry>


      <varlistentry>
        <term><group choice='plain'>
          <arg choice='plain'><option>-x</option></arg>
          <arg choice='plain'><option>--exit</option></arg>
        </group></term>

        <listitem>
          <para>Exit immediately if NetworkManager is not running or connecting.</para>
        </listitem>
      </varlistentry>

    </variablelist>
  </refsect1>

  <refsect1 id='exit_status'><title>Exit Status</title>

    <para><command>nm-online</command> exits with status 0 if it succeeds, a value
    greater than 0 is returned if an error occurs.</para>

    <variablelist spacing='compact' termlength='3'>
      <varlistentry>
        <term><errorcode>0</errorcode></term>
        <listitem>
          <para>Success &ndash; already online or connection established within given timeout.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><errorcode>1</errorcode></term>
        <listitem>
          <para>Offline or not online within given timeout.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><errorcode>2</errorcode></term>
        <listitem>
          <para>Unknown or unspecified error.</para>
        </listitem>
      </varlistentry>

    </variablelist>
  </refsect1>

  <refsect1 id='see_also'><title>See Also</title>
    <para><link linkend='nmcli'><citerefentry><refentrytitle>nmcli</refentrytitle><manvolnum>1</manvolnum></citerefentry></link>,
    <link linkend='NetworkManager'><citerefentry><refentrytitle>NetworkManager</refentrytitle><manvolnum>8</manvolnum></citerefentry></link>,
    <link linkend='NetworkManager-wait-online.service'><citerefentry><refentrytitle>NetworkManager-wait-online.service</refentrytitle><manvolnum>8</manvolnum></citerefentry></link>.
    </para>
  </refsect1>

</refentry>