keepalive_thread() cleanup. Also fixes a segfault when doing a SIGHUP.
[pwmd.git] / doc / pwmd.1.in
blob39daea863bd33c831512c9e37be0bfb16e76c41f
1 .\" This program is free software; you can redistribute it and/or modify
2 .\" it under the terms of the GNU General Public License as published by
3 .\" the Free Software Foundation; either version 2 of the License, or
4 .\" (at your option) any later version.
5 .\" 
6 .\" This program is distributed in the hope that it will be useful,
7 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
8 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
9 .\" GNU General Public License for more details.
10 .\" 
11 .\" You should have received a copy of the GNU General Public License
12 .\" along with this program; if not, write to the Free Software
13 .\" Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02110-1301  USA
14 .de URL
15 \\$2 \(laURL: \\$1 \(ra\\$3
17 .if \n[.g] .mso www.tmac
18 .TH PWMD 1 "19 Apr 2009" "Password Manager Daemon" "Password Manager Daemon"
19 .SH NAME
21 pwmd \- a universal data server
22 .SH SYNOPSIS
23 .B pwmd
24 [\-hvDnP] [\-f <rcfile>] [\-I <filename> [\-i <iterations>]] [\-k <keyfile>]
25 [\-C <filename>] [\-o <filename>] [file] [...]
27 .SH DESCRIPTION
28 .B pwmd
29 is a daemon/server that serves clients data which is stored in a, optionally
30 encrypted and compressed, XML data file. Clients connect and send commands
31 that either retrieve or store data.
33 .SH OPTIONS
34 The following are the available command line options. Remaining arguments are
35 files to add to the cache on startup.
36 .TP
37 .I "\-f rcfile"
38 Specify an alternate configuration file. The default is \fI~/.pwmd/config\fR.
39 .TP
40 .I "\-I filename \-o filename"
41 Imports an XML file. The XML file should be in conformance to the pwmd DTD.
42 See COMMANDS contained in the distributed pwmd archive for details. If
43 encryption is wanted (specified with the \fIiterations\fP configuration
44 parameter or the \fB\-i\fP command line switch), you will be prompted for a
45 passphrase to encrypt with. The output is written to the filename specified
46 with the \fI\-o\fP command line switch which should then be placed in the
47 configured \fIdata_directory\fP.
48 .TP
49 .I "\-i iterations
50 The number of encryption iterations to use when importing. When not specified,
51 the \fIiterations\fP configuration option from the \fIglobal\fP section will
52 be used.
53 .TP
54 .I "\-k keyfile"
55 When importing (\fB-I\fP) or converting (\fB-C\fP), obtain the key from the
56 specified filename. Only the first line is read from this file. Be sure to set
57 \fIkey_file\fP in your configuration.
58 .TP
59 .I "\-C filename \-o filename"
60 Converts a \fBpwmd\fP version 1 data file to a version 2 data file. If
61 encrypted, you will be prompted for a passphrase to use for decryption (unless
62 using \fB-k\fP). The converted data file will be saved to the filename
63 specified with the \fB-o\fP command line switch and with the same passphrase
64 and iterations as the version 1 data file.
65 .TP
66 .I "\-D"
67 Disable the XPATH, LIST and DUMP protocol commands.
68 .TP
69 .I "\-n"
70 Run as a foreground process.
71 .TP
72 .I "\-P"
73 Disable
74 .BR pinentry (1)
75 support overriding any configuration setting.
76 .TP
77 .I "\-v"
78 Version information.
79 .TP
80 .I "\-h"
81 Help text.
83 .SH CONFIGURATION FILE
84 Blank lines and lines beginning with '#' are ignored. Some options can have
85 data file-specific settings by placing them in a file section. A file section
86 is declared by surrounding the filename with braces (i.e., \fI[filename]\fP).
87 Global options may be specified in a \fI[global]\fP section and are the
88 default options for new or unspecified files. If the first character of a
89 string value is a tilde, it will be expanded to your home directory. First the
90 global options:
91 .TP
92 .I "socket_path=<string>"
93 Listen on the specified socket. The default is \fI~/.pwmd/socket\fR.
94 \fBpwmd\fP will always listen on a local socket.
95 .TP
96 .I "socket_perms=<integer>"
97 Permissions to set after creating the socket. This will override any
98 .BR umask (2)
99 setting.
101 .I "data_directory=<string>"
102 Where
103 .B pwmd
104 should store and retrieve data files. The default is \fI~/.pwmd/data\fR.
106 .I "disable_mlockall=<boolean>"
107 When set to \fBfalse\fP,
108 .BR mlockall (2)
109 will be called after the client connects. This will use alot more physical
110 memory but may also be more secure. Most will probably find it overkill since
111 the contents of all allocated memory is cleared before being freed. Note that
112 this doesn't affect the file cache which is always stored in RAM (if
113 possible).
115 .I "log_path=<string>"
116 Logs informational messages to the specified file. The default is
117 \fI~/.pwmd/log\fR.
119 .I "enable_logging=<boolean>"
120 Enable or disable logging to \fIlog_path\fR. The default is \fIfalse\fR.
122 .I "syslog=<boolean>"
123 Enable logging to
124 .BR syslog (8)
125 with facility LOG_DAEMON and priority LOG_INFO. The default is \fIfalse\fR.
127 .I "disable_list_and_dump=<boolean>"
128 When \fItrue\fP, the \fBXPATH\fP, \fBLIST\fP and \fBDUMP\fP protocol commands
129 will be disabled and will return an error code.
131 .I "cache_push=<list>"
132 A list of filenames separated by commas that will be pushed into the file
133 cache upon startup.
134 .B pwmd
135 will ask for the key for each file specified unless the key was specified with
136 the \fBkey\fR or \fBkey_file\fR parameters in a matching file section. The
137 default is none.
139 .I "priority=<integer>"
140 The priority, or niceness, of the server. The default is inherited from the
141 parent process.
143 Below are options that can be specified in the \fI[global]\fP or
144 \fI[filename]\fP section. If in both then \fI[filename]\fP will have
145 precedence.
147 .I "backup=<boolean>"
148 Whether to create a backup of the data file when saving. The default is
149 \fItrue\fP. The backup filename has the .backup extension appended to the
150 opened file.
152 .I "cache_timeout=<integer>"
153 The number of seconds to keep the cache entry for this file. If \fI-1\fP, the
154 cache entry is kept forever. If \fI0\fP, each time the file is opened or saved
155 a key will be required.
157 .I "enable_pinentry=<boolean>"
158 If \fIfalse\fP, disable the use of
159 .BR pinentry (1).
160 When disabled and a file requires a passphrase, the passphrase must be
161 included in the command (see COMMANDS included in the archive). The default is
162 \fItrue\fP. Also see \fBPINENTRY\fP below.
164 .I "pinentry_timeout=<integer>"
165 The number of seconds before the pinentry dialog will terminate while waiting
166 for a passphrase. The default is \fB20\fP. Set to \fI0\fP to wait forever.
168 .I "iterations=<integer>"
169 The number of times to encrypt the data. A value of 10000 or more will make
170 dictionary attacks very slow depending on the CPU. The default is \fI1\fP
171 iteration. Setting to \fI0\fP will disable encryption.
173 .I "iteration_progress=<integer>"
174 After the specified number of iterations have been processed while encrypting
175 or decrypting, a status message with the keyword \fBPROGRESS\fP will be sent
176 to the client.  Setting to \fI0\fP, the default, disables sending progress
177 messages.
179 .I "xfer_progress=<integer>"
180 Send the XFER status message after the specified number of bytes have been
181 sent to the client. The specified number of bytes is rounded to
182 ASSUAN_LINELENGTH (1002) bytes.
184 .I "key=<string>"
185 The initial passphrase to use for this file. If specified in the
186 \fI[global]\fP section then "\fIglobal\fP" is treated as a data filename and
187 not a default for other files. Note that if a client changes the passphrase
188 for this data file with the \fBSAVE\fP command, then this value is not
189 modified and will need to be updated by hand.
191 .I "key_file=<string>"
192 Same as the \fBkey\fP option above but obtains the key from the specified
193 filename with the key being on the first line of the file. Note that if the
194 cache entry for this file gets removed then the only way to have it added
195 again is to restart \fBpwmd\fP or to re-read the configuration file (i.e., you
196 won't be prompted from pinentry).
198 .I "compression_level=<integer>"
199 The default compression level for data files from \fI1\fP to \fI9\fP, \fI1\fP
200 being the fastest but least compression and \fI9\fP being the slowest but best
201 compression. To disable compression entirely, set to \fI0\fP. The default is
202 \fI6\fP.
204 .I "zlib_bufsize=<integer>"
205 The input and output buffer size when compressing and decompressing. This
206 affects how often the COMPRESS and DECOMPRESS status messages are sent and
207 also affects compression quality. The default is \fB65536\fP. Set to a higher
208 value for larger files.
210 .I "recursion_depth=<integer>"
211 The maximum number of times to resolve a target attribute for a single element
212 in an element path. An error is returned when this value is exceeded. The
213 default is \fI20\fP but can be disabled by setting to \fI0\fP.
215 .I "keepalive=<integer>"
216 Sends keep alive status messages to the client every N seconds. Set to \fI0\fP
217 to disable. The default is \fI5\fP.
219 .SH PINENTRY
221 When \fIenable_pinentry\fP is \fBtrue\fP, commands that require a key
222 will use
223 .BR pinentry (1)
224 to retrieve the passphrase. Since \fBpwmd\fP is a daemon process, it isn't
225 attached to any terminal. So \fBpinentry\fP needs to know where to put it's
226 dialog box by using command line options when executed. These can be set by
227 either using protocol commands (see COMMANDS included in the archive) or by
228 creating a file \fI~/.pwmd/pinentry.conf\fP. When using the file, each line
229 should contain NAME=VALUE pairs where NAME is one of:
231 .B TTYNAME
232 The full path of the tty device.
234 .B TTYTYPE
235 The terminal type (i.e., vt100). Should be set when \fBTTYNAME\fP is set.
237 .B DISPLAY
238 If using an X11 pinentry.
240 .B LC_CTYPE
241 For internationalization.
243 .B LC_MESSAGES
244 For internationalization.
246 .B PATH
247 The full path to the pinentry binary. The default is \fI@pinentry@\fP.
249 The file is read only once after each client first connects. Note that if your
250 not using a \fBDISPLAY\fP, then both \fBTTYNAME\fP and \fBTTYTYPE\fP should be
251 set otherwise you'll get a segfault from ncurses.
253 .SH SIGNALS
255 .B SIGUSR1
256 Clears the entire file cache. If there are any clients connected, a key will
257 be required for the next \fBOPEN\fP or \fBSAVE\fP command.
259 .B SIGHUP
260 Reloads the configuration file.
262 .B SIGTERM and SIGINT
263 Disallows new connections and waits for all clients to disconnect before
264 terminating.
266 .SH FILES
268 .B ~/.pwmd/config
269 Default configuration file.
271 .B ~/.pwmd/data
272 Default data directory.
274 .B ~/.pwmd/socket
275 Default listening socket.
277 .B ~/.pwmd/log
278 Default log file when logging is enabled.
280 .B @pinentry@
281 Default location of the pinentry binary.
283 .B ~/.pwmd/pinentry.conf
284 Default pinentry settings for new clients.
286 .SH AUTHOR
287 Ben Kibbey <bjk@luxsci.net>
289 .URL "http://bjk.sourceforge.net/pwmd/" "PWMD Homepage" .
291 .SH "SEE ALSO"
292 .BR pinentry (1)
294 Also see \fBCOMMANDS\fP included in the archive for protocol commands and
295 syntax.