-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgotime.8
107 lines (107 loc) · 2.35 KB
/
gotime.8
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
.\"
.\" Copyright (c) 2021 Scott Bennett <scottb@fastmail.com>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd June 24, 2021
.Dt GOTIME 8
.Os
.Sh NAME
.Nm gotime
.Nd simple Daytime Protocol daemon written in go
.Sh SYNOPSIS
.Nm gotime
.Op Fl d
.Sh DESCRIPTION
.Nm
is a privilege-dropping server that implements the Daytime Protocol as specified in
RFC 867.
It responds to TCP connections on port
.Em 13 ,
returns a human-readable date string to the client,
then closes the connection.
Time portion of the date string is reported in UTC.
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl d
Debug mode.
.Nm
will run in the foreground and output debug messages to stdout.
root privileges are not required for startup and the server will listen on
.Em localhost
port
.Em 13013 .
.El
.Sh BUILD AND INSTALL
To build
.Nm :
.Pp
.Dl $ make
.Pp
To clean things up:
.Pp
.Dl $ make clean
.Pp
To install, first create the necessary user account,
then install the program and the
.Xr rc.d 8
script:
.Bd -literal -offset indent
# make user
# make install
.Ed
.Pp
To hook
.Nm
into the
.Xr rc 8
system, simply add
.Nm
to the
.Va pkg_scripts
variable in
.Xr rc.conf 8 :
.Pp
.Dl pkg_scripts=gotime
.Sh EXAMPLES
Request current date and time from a local
.Nm
instance running in debug mode:
.Pp
.Dl $ nc localhost 13013
.Pp
Make a request to a remote server running
.Nm :
.Pp
.Dl $ nc puffy.example.com 13
.Sh SEE ALSO
.Xr rc 8 ,
.Xr rc.conf 8 ,
.Xr rc.d 8 ,
.Pp
.Lk https://github.com/sbennett1990/daytimed "daytimed(8)"
.Sh AUTHORS
.An Scott Bennett
.Sh CAVEATS
.Nm
has only been built and tested on
.Ox 6.8
and newer, because it relies on
.Xr pledge 2
and the
.Xr rc 8
system.
.Pp
.Nm
only listens on IPv4 addresses.