Browse Source

improve ntpctl usage so that the manual page does not need to be read

every time
ok jmc
OPENBSD_5_5
deraadt 11 years ago
parent
commit
5d614be5df
2 changed files with 9 additions and 14 deletions
  1. +7
    -12
      src/usr.sbin/ntpd/ntpctl.8
  2. +2
    -2
      src/usr.sbin/ntpd/ntpd.c

+ 7
- 12
src/usr.sbin/ntpd/ntpctl.8 View File

@ -1,4 +1,4 @@
.\" $OpenBSD: ntpctl.8,v 1.4 2013/10/16 21:23:59 jmc Exp $
.\" $OpenBSD: ntpctl.8,v 1.5 2014/01/10 22:54:12 deraadt Exp $
.\" .\"
.\" Copyright (c) 2012 Mike Miller <mmiller@mgm51.com> .\" Copyright (c) 2012 Mike Miller <mmiller@mgm51.com>
.\" .\"
@ -14,7 +14,7 @@
.\" AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT .\" AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
.\" OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\" .\"
.Dd $Mdocdate: October 16 2013 $
.Dd $Mdocdate: January 10 2014 $
.Dt NTPCTL 8 .Dt NTPCTL 8
.Os .Os
.Sh NAME .Sh NAME
@ -22,7 +22,7 @@
.Nd control the Network Time Protocol daemon .Nd control the Network Time Protocol daemon
.Sh SYNOPSIS .Sh SYNOPSIS
.Nm ntpctl .Nm ntpctl
.Op Fl s Ar modifier
.Op Fl s Cm all | peers | sensors | status
.Sh DESCRIPTION .Sh DESCRIPTION
The The
.Nm .Nm
@ -32,25 +32,21 @@ daemon.
.Pp .Pp
The options are as follows: The options are as follows:
.Bl -tag -width "-s modifierX" .Bl -tag -width "-s modifierX"
.It Fl s Ar modifier
Show the data specified by
.Ar modifier :
.Bl -tag -width "sensorsXXX"
.It Cm all
.It Fl s Cm all
Show all data. Show all data.
.It Cm peers
.It Fl s Cm peers
Show the following information about each peer: weight, trustlevel, Show the following information about each peer: weight, trustlevel,
stratum, number of seconds until the next poll, polling interval stratum, number of seconds until the next poll, polling interval
in seconds, and offset, network delay and network jitter in milliseconds. in seconds, and offset, network delay and network jitter in milliseconds.
When the system clock is synced to a peer, an asterisk When the system clock is synced to a peer, an asterisk
is displayed to the left of the weight column for that peer. is displayed to the left of the weight column for that peer.
.It Cm sensors
.It Fl s Cm sensors
Show the following information about each sensor: weight, sensor "good" Show the following information about each sensor: weight, sensor "good"
status, stratum, and offset and the configured correction in status, stratum, and offset and the configured correction in
milliseconds. milliseconds.
When the system clock is synced to a sensor, an asterisk When the system clock is synced to a sensor, an asterisk
is displayed to the left of the weight column for that sensor. is displayed to the left of the weight column for that sensor.
.It Cm status
.It Fl s Cm status
Show the status of peers and sensors, and whether the system clock is synced. Show the status of peers and sensors, and whether the system clock is synced.
When the system clock is synced, the stratum is displayed. When the system clock is synced, the stratum is displayed.
When the system clock is not synced, the offset of the system clock, When the system clock is not synced, the offset of the system clock,
@ -58,7 +54,6 @@ as reported by the
.Xr adjtime 2 .Xr adjtime 2
system call, is displayed. system call, is displayed.
.El .El
.El
.Sh FILES .Sh FILES
.Bl -tag -width "/var/run/ntpd.sockXXX" -compact .Bl -tag -width "/var/run/ntpd.sockXXX" -compact
.It Pa /var/run/ntpd.sock .It Pa /var/run/ntpd.sock


+ 2
- 2
src/usr.sbin/ntpd/ntpd.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: ntpd.c,v 1.75 2013/11/13 20:44:39 benno Exp $ */
/* $OpenBSD: ntpd.c,v 1.76 2014/01/10 22:54:12 deraadt Exp $ */
/* /*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -81,7 +81,7 @@ usage(void)
extern char *__progname; extern char *__progname;
if (strcmp(__progname, "ntpctl") == 0) if (strcmp(__progname, "ntpctl") == 0)
fprintf(stderr, "usage: ntpctl [-s modifier]\n");
fprintf(stderr, "usage: ntpctl [-s all | peers | sensors | status]\n");
else else
fprintf(stderr, "usage: %s [-dnSsv] [-f file]\n", fprintf(stderr, "usage: %s [-dnSsv] [-f file]\n",
__progname); __progname);


Loading…
Cancel
Save