# Ntp-wait User's Manual

This document describes the use of the NTP Project's `ntp-wait` program.

If there are time-sensitive applications, the proper sequence of events is to run `ntpd -g` as early as possible, then invoke all of the non-time-sensitive process, run `ntp-wait` to block until the system's time has stabilized and synchronized, and only then start any applicaitons (like database servers) that require accurate and stable time.

This document applies to version 4.2.7p418 of `ntp-wait`.

## Short Contents

### 0.1 Invoking ntp-wait

`ntp-wait` will send at most `num-tries` queries to `ntpd(8)`, sleeping for `secs-between-tries` after each status return that says `ntpd(8)` has not yet produced a synchronized and stable system clock.

`ntp-wait` will do this quietly, unless the `-v` flag is provided. This can be useful at boot time, to delay the boot sequence until after `ntpd` `-g` has set the time.

This section was generated by AutoGen, using the `agtexi-cmd` template and the option descriptions for the `ntp-wait` program.

#### 0.1.1 ntp-wait help/usage (--help)

This is the automatically generated usage text for ntp-wait.

The text printed is the same whether selected with the `help` option (--help) or the `more-help` option (--more-help). `more-help` will print the usage text by passing it through a pager program. `more-help` is disabled on platforms without a working `fork(2)` function. The `PAGER` environment variable is used to select the program, defaulting to more. Both will exit with a status code of 0.

    ntp-wait - Wait for ntpd to stabilize the system clock - Ver. 4.2.7p411
    USAGE: ntp-wait [ -<flag> [<val>] | --<name>[{=| }<val>] ]...

        -n, --tries=num              Number of times to check ntpd
        -s, --sleep=num              How long to sleep between tries
        -v, --verbose                Be verbose
        -?, --help                   Display usage information and exit
          , --more-help              Pass the extended usage information through a pager

    Options are specified by doubled hyphens and their name or by a single
    hyphen and the flag character.

#### 0.1.2 tries option (-n)

This is the “number of times to check ntpd” option. This option takes a number argument. The maximum number of times we will check `ntpd` to see if it has been able to synchronize and stabilize the system clock.

#### 0.1.3 sleep option (-s)

This is the “how long to sleep between tries” option. This option takes a number argument secs-between-tries. We will sleep for secs-between-tries after each query of `ntpd` that returns "the time is not yet stable".

#### 0.1.4 verbose option (-v)

This is the “be verbose” option. By default, `ntp-wait` is silent. With this option, `ntp-wait` will provide status information.

#### 0.1.5 ntp-wait exit status

One of the following exit values will be returned:

0 (EXIT_SUCCESS)
  Successful program execution.
1 (EXIT_FAILURE)
  The operation failed or the command syntax was not valid.

#### 0.1.6 ntp-wait Authors

#### 0.1.7 ntp-wait Notes