chiark / gitweb /
server/admin: Fix tokenization of statistics output.
[tripe] / doc / tripectl.1
CommitLineData
d6623498 1.\" -*-nroff-*-
87154d69 2.de VS
3.sp 1
4.RS
5.nf
6.ft B
7..
8.de VE
9.ft R
10.fi
11.RE
12.sp 1
13..
14.ie t \{\
15. if \n(.g \{\
16. fam P
17. \}
18.\}
d6623498 19.TH tripectl 1 "19 February 2001" "Straylight/Edgeware" "TrIPE: Trivial IP Encryption"
20.SH NAME
21tripectl \- simple client for TrIPE
22.SH SYNOPSIS
23.B tripectl
24.RB [ \-w ]
25.RB [ \-\fIoptions ]
26.RI [ command
27.RI [ args ]...]
28.br
29.B tripectl
30.RB [ \-Dl ]
31.RB [ \-f
32.IR file ]
33.RB [ \-\fIoptions ]
34.PP
35Options:
36.br
37 \&
38.RB [ \-s ]
39.RB [ \-d
87154d69 40.IR dir ]
d6623498 41.RB [ \-a
42.IR socket ]
87154d69 43.RB [ \-P
44.IR pidfile ]
d6623498 45.br
46 \&
47.RB [ \-p
48.IR program ]
49.RB [ \-S
50.IB arg , arg ,\fR...]
51.SH DESCRIPTION
87154d69 52The
53.B tripectl
1a19f865 54program is a simple client which can be used, either interactively or
55from a script, to send commands to and read status information from a
56running
87154d69 57.BR tripe (8)
58server. It can also be used to start
59.BR tripe (8),
60passing appropriate arguments and capturing logging information.
61.SS "Command-line options"
62.TP
63.B "\-h, \-\-help"
64Writes a brief description of the command-line options available to
65standard output and exits with status 0.
66.TP
67.B "\-v, \-\-version"
68Writes tripe's version number to standard output and exits with status
690.
70.TP
71.B "\-u, \-\-usage"
72Writes a brief usage summary to standard output and exits with status 0.
73.TP
74.B "\-D, \-\-daemon"
75Makes
76.B tripectl
77disassociate from the terminal and become a background process after
78connecting to the server.
79.TP
80.BI "\-d, \-\-directory=" dir
81Make
82.I dir
83the current directory, before doing anything else. Note that all the
84other filenames (e.g., the log output file) are relative to this
85directory. The default directory, if this option is not specified, is
86taken from the environment variable
87.BR TRIPEDIR ;
88if that's not defined either, a default default of
89.BR /var/lib/tripe
90is used.
91.TP
92.BI "\-a, \-\-admin=" socket
93If connecting to a running server, connect to the socket named
7cf0f3cc 94.IR socket ;
95if running a new server, instruct it to listen for admin
87154d69 96connections on
97.IR socket .
98.TP
99.BI "\-P, \-\-pidfile=" pidfile
100Write
101.BR tripectl 's
102process-id to
103.I pidfile
104(relative to
105.IR dir ).
106If the
107.B \-D
108and
109.B \-f
110options are given, a default of
111.IB dir /tripectl.pid
112is used if you don't give a
113.B \-P
114option.
115.TP
116.B "\-s, \-\-spawn"
117Start a new server: don't connect to an existing one. Starting a
118.BR tripe (8)
119server in this manner is a good way to ensure that no log messages are
120lost. The
121.BR \-l ,
122.B \-f
123and
124.B \-D
125options are particularly useful in conjunction with
126.BR \-s .
127.TP
128.BI "\-p, \-\-spawn\-path=" path
129Implies
130.BR \-s ;
131runs the program named by
132.I path
133rather than the default
134.BR tripe .
135If
136.I path
137is actually an unqualified filename, the program to run is found using
138the
139.B PATH
140environment variable in the usual way.
141.TP
142.BI "\-S, \-\-spawn\-args=" arg , arg ,\fR...
143Implies
144.BR \-s ;
145passes the comma-separated
146.IR arg s
147to the
148.B tripe
149server on its command line. Arguments added using this option are added
150.I after
151any passed automatically by
152.B tripectl
153(e.g.,
154.BR \-a ).
155.TP
156.B "\-l, \-\-syslog"
157Send warnings and trace messages to the
158.BR syslog (8)
159service. Messages are logged using the
160.B daemon
161facility. Warnings are logged with severity
162.BR warning ;
163trace messages are logged with severity
164.BR debug .
165.TP
166.BI "\-f, \-\-logfile=" file
167Write warnings and trace messages to
168.IR file .
169On receipt of a
170.B SIGHUP
171signal,
172.B tripectl
173will close its log file and reopen a new one with the same name. This
174is useful when you rotate logs.
175.TP
176.B "\-w, \-\-warnings"
177Write warnings to standard error even when running noninteractively.
178.SS "Interactive use"
179With no arguments,
180.B tripectl
181will connect to a running server and await commands from its standard
182input. The commands are submitted to the server unchanged, and the
183results written to standard output. It will quit when it receives a
184fatal signal or an end-of-file indication from the server.
185.SS "Use from scripts"
186If arguments are given to
187.BR tripectl ,
188they are concatenated with spaces between and submitted to the server
189after connection. Any
190.B INFO
191responses returned by the server are written to standard output (without
192the
193.B INFO
194on the front). A
195.B FAIL
196response causes the error message to be written to standard error, and
197the client to exit with a nonzero return code. An
198.B OK
199response causes the client to exit with a zero return code. Unless the
200.B \-w
201command-line option was given, any
202.B WARN
203responses are discarded; if
204.B \-w
205.I was
206given,
207.B WARN
208responses are written to standard error. In all cases,
209.B TRACE
210responses are ignored.
211.SS "Starting the tripe server"
212If any of the options
213.BR \-s ,
214.B \-p
215or
216.B \-S
217are given,
218.B tripectl
219will start a new
220.B tripe
221server, rather than connecting to an existing one. This is most useful
222if you want to collect logging information from the server, and want to
223avoid losing any. For example, the command
224.VS
225tripectl -Ds -f tripe.log
226.VE
227starts up a new server in the default directory, and captures all of its
228logging output (i.e.,
229.B WARN
230and
231.B TRACE
232messages) in the file
233.BR tripe.log .
234It stores its process-id in
235.BR tripectl.pid .
236.PP
237It's possible to communicate interactively with a newly-started server,
238or to give it a command and quit, but this is seldom useful.
239.SH "SEE ALSO"
240.BR tripe\-admin (5),
241.BR tripe (8).
242.PP
243.IR "The Trivial IP Encryption Protocol" ,
244.IR "The Wrestlers Protocol" .
245.SH "AUTHOR"
98fdb08d 246Mark Wooding, <mdw@distorted.org.uk>