]> gitweb.michael.orlitzky.com - dead/htsn.git/blob - doc/man1/htsn.1
Update pidfile documentation.
[dead/htsn.git] / doc / man1 / htsn.1
1 .TH htsn 1
2
3 .SH NAME
4 htsn \- Parse XML files from The Sports Network feed.
5
6 .SH SYNOPSIS
7
8 \fBhtsn\fR [OPTIONS] [HOSTNAMES]
9
10 .SH DESCRIPTION
11 .P
12 The Sports Network <http://www.sportsnetwork.com/> offers an XML feed
13 containing various sports news and statistics. The goal of \fBhtsn\fR
14 is to watch the XML feed and parse the individual XML documents into
15 files.
16 .P
17 Once started, we will choose an XML feed host to connect to. The
18 choice is made from a list in a round-robin fashion, and by default,
19 the list contains all known TSN feed hosts. Once we have a connection,
20 your username and password are sent. If they are accepted, we begin to
21 parse the feed saving all XML files to the configured output directory
22 (see \fI\-\-output\-directory\fR).
23 .P
24 If we encounter an error (say, the connection is dropped), then we
25 will attempt to connect to the next host in the list after waiting
26 five seconds. This process continues indefinitely.
27 .P
28 The program can run either interactively (that is, outputting to the
29 console), or as a daemon with the \fI\-\-daemonize\fR flag.
30
31 .SH INPUT
32 .P
33 The program takes no input; a username and password must be supplied
34 on the command-line or in a configuration file.
35
36 .SH OUTPUT
37 .P
38 Output is not generated when running as a daemon; otherwise, standard
39 out and standard error are fairly noisy. All traffic between htsn and
40 the feed server is displayed on stdout. Status messages are
41 interspersed when they are generated with warnings and errors going to
42 stderr. The following can be expected:
43 .IP \[bu] 2
44 The only data we send to the feed are the username and password. These
45 will be highlighted in green on stdout.
46 .IP \[bu]
47 All data received from the feed will be echoed in the default color to
48 stdout.
49 .IP \[bu]
50 Informational messages will be highlighted in cyan and sent to stdout.
51 .IP \[bu]
52 Warnings will be highlighted in yellow and sent to stderr.
53 .IP \[bu]
54 Errors will be highlighted in red and sent to stderr.
55
56 .SH LOGGING
57 .P
58 Logging is done either to syslog or a file. The destination and
59 verbosity are controlled by the \fI\-\-log\-file\fR,
60 \fI\-\-log\-level\fR, and \fI\-\-syslog\fR parameters which may be
61 specified either on the command line or in the configuration file.
62
63 .SH OPTIONS
64
65 .IP \fB\-\-daemonize\fR,\ \fB\-d\fR
66 Run as a daemon, in the background. When running as a daemon the
67 \fI\-\-pidfile\fR, \fI\-\-run\-as\-group\fR, and
68 \fI\-\-run\-as\-user\fR flags become relevant.
69
70 Default: disabled
71
72 .IP \fB\-\-log-file\fR
73 If you specify a file here, logs will be written to it (possibly in
74 addition to syslog). Can be either a relative or absolute path. It
75 will not be auto-rotated; use something log logrotate for that.
76
77 Default: none
78
79 .IP \fB\-\-log-level\fR
80 How verbose should the logs be? We log notifications at three levels:
81 INFO, WARN, and ERROR. Specify the \(dqmost boring\(dq level of
82 notifications you would like to receive (in all-caps); more
83 interesting notifications will be logged as well.
84
85 Default: INFO
86
87 .IP \fB\-\-output\-directory\fR,\ \fB\-o\fR
88 To which directory should we write the XML files?
89
90 Default: .
91
92 .IP \fB\-\-password\fR
93 The password associated with your TSN username. A password is
94 required, so you must supply one either on the command line or in a
95 configuration file.
96
97 Default: none
98
99 .IP \fB\-\-pidfile\fR
100 (Daemon mode only) Create a PID file in the given location. This is
101 used by the init system on Unix to keep track of the running daemon.
102
103 If necessary, its parent directory will be created with owner/group
104 set to the appropriate user/group, but at most one directory will be
105 created (that is, we won't create an entire directory tree).
106
107 Default: /run/htsn/htsn.pid
108
109 .IP \fB\-\-run\-as\-group\fR
110 (Daemon mode only) Run as the given system group. The PID file is
111 written before privileges are dropped, so the only privileges needed
112 by htsn are those necessary to write the XML files and (optionally)
113 the log file.
114
115 Default: the current group
116
117 .IP \fB\-\-run\-as\-user\fR
118 (Daemon mode only) Run as the given system user. The PID file is
119 written before privileges are dropped, so the only privileges needed
120 by htsn are those necessary to write the XML files and (optionally)
121 the log file.
122
123 Default: the current user
124
125 .IP \fB\-\-syslog\fR,\ \fB\-s\fR
126 Enable logging to syslog. On Windows this will attempt to communicate
127 (over UDP) with a syslog daemon on localhost, which will most likely
128 not work.
129
130 Default: disabled
131
132 .IP \fB\-\-username\fR,\ \fB\-u\fR
133 Your TSN username. A username is required, so you must supply one
134 either on the command line or in a configuration file.
135
136 Default: none
137
138 .SH FEED HOSTS
139 .P
140 It is possible to pass a list of feed hostnames on the command-line
141 (see [HOSTNAMES] in the synopsis). By default \fBhtsn\fR will attempt
142 to connect to every known TSN XML feed host in a round-robin fashion,
143 so there is rarely a need to do this.
144
145 .SH CONFIGURATION FILE
146 .P
147 Any of the command-line options mentioned above can be specified in a
148 configuration file instead. We first look for \(dqhtsnrc\(dq in the
149 system configuration directory. We then look for a file named
150 \(dq.htsnrc\(dq in the user's home directory. The latter will override
151 the former.
152 .P
153 The user's home directory is simply $HOME on Unix; on Windows its
154 wherever %APPDATA% points. The system configuration directory is
155 determined by Cabal; the \(dqsysconfdir\(dq parameter during the
156 \(dqconfigure\(dq step is used.
157 .P
158 The file's syntax is given by examples in the htsnrc.example file
159 (included with \fBhtsn\fR).
160 .P
161 Options specified on the command-line override those in either
162 configuration file.
163
164 .SH BUGS
165
166 .P
167 Send bugs to michael@orlitzky.com.