From 5d614be5df96fe6fd897f20c1b0f356dfbdc15ef Mon Sep 17 00:00:00 2001 From: deraadt <> Date: Fri, 10 Jan 2014 22:54:12 +0000 Subject: [PATCH] improve ntpctl usage so that the manual page does not need to be read every time ok jmc --- src/usr.sbin/ntpd/ntpctl.8 | 19 +++++++------------ src/usr.sbin/ntpd/ntpd.c | 4 ++-- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/src/usr.sbin/ntpd/ntpctl.8 b/src/usr.sbin/ntpd/ntpctl.8 index 37a63ef9..cdb98dcc 100644 --- a/src/usr.sbin/ntpd/ntpctl.8 +++ b/src/usr.sbin/ntpd/ntpctl.8 @@ -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 .\" @@ -14,7 +14,7 @@ .\" AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT .\" 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 .Os .Sh NAME @@ -22,7 +22,7 @@ .Nd control the Network Time Protocol daemon .Sh SYNOPSIS .Nm ntpctl -.Op Fl s Ar modifier +.Op Fl s Cm all | peers | sensors | status .Sh DESCRIPTION The .Nm @@ -32,25 +32,21 @@ daemon. .Pp The options are as follows: .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. -.It Cm peers +.It Fl s Cm peers Show the following information about each peer: weight, trustlevel, stratum, number of seconds until the next poll, polling interval in seconds, and offset, network delay and network jitter in milliseconds. When the system clock is synced to a peer, an asterisk 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" status, stratum, and offset and the configured correction in milliseconds. When the system clock is synced to a sensor, an asterisk 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. When the system clock is synced, the stratum is displayed. When the system clock is not synced, the offset of the system clock, @@ -58,7 +54,6 @@ as reported by the .Xr adjtime 2 system call, is displayed. .El -.El .Sh FILES .Bl -tag -width "/var/run/ntpd.sockXXX" -compact .It Pa /var/run/ntpd.sock diff --git a/src/usr.sbin/ntpd/ntpd.c b/src/usr.sbin/ntpd/ntpd.c index 53433c55..62c4b721 100644 --- a/src/usr.sbin/ntpd/ntpd.c +++ b/src/usr.sbin/ntpd/ntpd.c @@ -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 @@ -81,7 +81,7 @@ usage(void) extern char *__progname; if (strcmp(__progname, "ntpctl") == 0) - fprintf(stderr, "usage: ntpctl [-s modifier]\n"); + fprintf(stderr, "usage: ntpctl [-s all | peers | sensors | status]\n"); else fprintf(stderr, "usage: %s [-dnSsv] [-f file]\n", __progname);