Print this page
5069 Removal of wu-ftpd
Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
Reviewed by: Garrett D'Amore <garrett@damore.org>
Reviewed by: Milan Jurik <milan.jurik@xylab.cz>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Reviewed by: Gary Mills <gary_mills@fastmail.fm>
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Adam Stevko <adam.stevko@gmail.com>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man3c/syslog.3c
+++ new/usr/src/man/man3c/syslog.3c
1 1 '\" te
2 2 .\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved.
3 3 .\" Copyright (c) 1983 Regents of the University of California. All rights reserved. The Berkeley software License Agreement specifies the terms and conditions for redistribution.
4 4 .\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
5 5 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at http://www.opengroup.org/bookstore/.
6 6 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text
7 7 .\" are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical
8 8 .\" and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
9 9 .\" This notice shall appear on any product containing this material.
10 10 .TH SYSLOG 3C "Mar 16, 2009"
11 11 .SH NAME
12 12 syslog, openlog, closelog, setlogmask \- control system log
13 13 .SH SYNOPSIS
14 14 .LP
15 15 .nf
16 16 #include <syslog.h>
17 17
18 18 \fBvoid\fR \fBopenlog\fR(\fBconst char *\fR\fIident\fR, \fBint\fR \fIlogopt\fR, \fBint\fR \fIfacility\fR);
19 19 .fi
20 20
21 21 .LP
22 22 .nf
23 23 \fBvoid\fR \fBsyslog\fR(\fBint\fR \fIpriority\fR, \fBconst char *\fR\fImessage\fR, \fB\&.../*\fR \fIarguments\fR */);
24 24 .fi
25 25
26 26 .LP
↓ open down ↓ |
26 lines elided |
↑ open up ↑ |
27 27 .nf
28 28 \fBvoid\fR \fBcloselog\fR(\fBvoid\fR);
29 29 .fi
30 30
31 31 .LP
32 32 .nf
33 33 \fBint\fR \fBsetlogmask\fR(\fBint\fR \fImaskpri\fR);
34 34 .fi
35 35
36 36 .SH DESCRIPTION
37 -.sp
38 37 .LP
39 38 The \fBsyslog()\fR function sends a message to \fBsyslogd\fR(1M), which,
40 39 depending on the configuration of \fB/etc/syslog.conf\fR, logs it in an
41 40 appropriate system log, writes it to the system console, forwards it to a list
42 41 of users, or forwards it to \fBsyslogd\fR on another host over the network.
43 42 The logged message includes a message header and a message body. The message
44 43 header consists of a facility indicator, a severity level indicator, a
45 44 timestamp, a tag string, and optionally the process ID.
46 45 .sp
47 46 .LP
48 47 The message body is generated from the \fImessage\fR and following arguments in
49 48 the same manner as if these were arguments to \fBprintf\fR(3UCB), except that
50 49 occurrences of \fB%m\fR in the format string pointed to by the \fImessage\fR
51 50 argument are replaced by the error message string associated with the current
52 51 value of \fBerrno\fR. A trailing \fBNEWLINE\fR character is added if needed.
53 52 .sp
54 53 .LP
55 54 Symbolic constants for use as values of the \fIlogopt\fR, \fIfacility\fR,
56 55 \fIpriority\fR, and \fImaskpri\fR arguments are defined in the <\fBsyslog.h\fR>
57 56 header.
58 57 .sp
59 58 .LP
60 59 Values of the \fIpriority\fR argument are formed by ORing together a
61 60 \fIseverity level\fR value and an optional \fIfacility\fR value. If no
62 61 facility value is specified, the current default facility value is used.
63 62 .sp
64 63 .LP
65 64 Possible values of severity level include, in decreasing order:
66 65 .sp
67 66 .ne 2
68 67 .na
69 68 \fB\fBLOG_EMERG\fR\fR
70 69 .ad
71 70 .RS 15n
72 71 A panic condition. This is normally broadcast to all users.
73 72 .RE
74 73
75 74 .sp
76 75 .ne 2
77 76 .na
78 77 \fB\fBLOG_ALERT\fR\fR
79 78 .ad
80 79 .RS 15n
81 80 A condition that should be corrected immediately, such as a corrupted system
82 81 database.
83 82 .RE
84 83
85 84 .sp
86 85 .ne 2
87 86 .na
88 87 \fB\fBLOG_CRIT\fR\fR
89 88 .ad
90 89 .RS 15n
91 90 Critical conditions, such as hard device errors.
92 91 .RE
93 92
94 93 .sp
95 94 .ne 2
96 95 .na
97 96 \fB\fBLOG_ERR\fR\fR
98 97 .ad
99 98 .RS 15n
100 99 Errors.
101 100 .RE
102 101
103 102 .sp
104 103 .ne 2
105 104 .na
106 105 \fB\fBLOG_WARNING\fR\fR
107 106 .ad
108 107 .RS 15n
109 108 Warning messages.
110 109 .RE
111 110
112 111 .sp
113 112 .ne 2
114 113 .na
115 114 \fB\fBLOG_NOTICE\fR\fR
116 115 .ad
117 116 .RS 15n
118 117 Conditions that are not error conditions, but that may require special
119 118 handling.
120 119 .RE
121 120
122 121 .sp
123 122 .ne 2
124 123 .na
125 124 \fB\fBLOG_INFO\fR\fR
126 125 .ad
127 126 .RS 15n
128 127 Informational messages.
129 128 .RE
130 129
131 130 .sp
132 131 .ne 2
133 132 .na
134 133 \fB\fBLOG_DEBUG\fR\fR
135 134 .ad
136 135 .RS 15n
137 136 Messages that contain information normally of use only when debugging a
138 137 program.
139 138 .RE
140 139
141 140 .sp
142 141 .LP
143 142 The facility indicates the application or system component generating the
144 143 message. Possible facility values include:
145 144 .sp
146 145 .ne 2
147 146 .na
148 147 \fB\fBLOG_KERN\fR\fR
149 148 .ad
150 149 .RS 14n
151 150 Messages generated by the kernel. These cannot be generated by any user
152 151 processes.
153 152 .RE
154 153
155 154 .sp
156 155 .ne 2
157 156 .na
158 157 \fB\fBLOG_USER\fR\fR
159 158 .ad
160 159 .RS 14n
161 160 Messages generated by random user processes. This is the default facility
162 161 identifier if none is specified.
163 162 .RE
164 163
165 164 .sp
166 165 .ne 2
167 166 .na
168 167 \fB\fBLOG_MAIL\fR\fR
169 168 .ad
↓ open down ↓ |
122 lines elided |
↑ open up ↑ |
170 169 .RS 14n
171 170 The mail system.
172 171 .RE
173 172
174 173 .sp
175 174 .ne 2
176 175 .na
177 176 \fB\fBLOG_DAEMON\fR\fR
178 177 .ad
179 178 .RS 14n
180 -System daemons, such as \fBin.ftpd\fR(1M).
179 +System daemons.
181 180 .RE
182 181
183 182 .sp
184 183 .ne 2
185 184 .na
186 185 \fB\fBLOG_AUTH\fR\fR
187 186 .ad
188 187 .RS 14n
189 188 The authentication / security / authorization system: \fBlogin\fR(1),
190 189 \fBsu\fR(1M), \fBgetty\fR(1M).
191 190 .RE
192 191
193 192 .sp
194 193 .ne 2
195 194 .na
196 195 \fB\fBLOG_LPR\fR\fR
197 196 .ad
198 197 .RS 14n
199 198 The line printer spooling system: \fBlpr\fR(1B), \fBlpc\fR(1B).
200 199 .RE
201 200
202 201 .sp
203 202 .ne 2
204 203 .na
205 204 \fB\fBLOG_NEWS\fR\fR
206 205 .ad
207 206 .RS 14n
208 207 Designated for the \fBUSENET\fR network news system.
209 208 .RE
210 209
211 210 .sp
212 211 .ne 2
213 212 .na
214 213 \fB\fBLOG_UUCP\fR\fR
215 214 .ad
216 215 .RS 14n
217 216 Designated for the \fBUUCP\fR system; it does not currently use \fBsyslog()\fR.
218 217 .RE
219 218
220 219 .sp
221 220 .ne 2
222 221 .na
223 222 \fB\fBLOG_CRON\fR\fR
224 223 .ad
225 224 .RS 14n
226 225 The \fBcron\fR/\fBat\fR facility; \fBcrontab\fR(1), \fBat\fR(1),
227 226 \fBcron\fR(1M).
228 227 .RE
229 228
230 229 .sp
231 230 .ne 2
232 231 .na
233 232 \fB\fBLOG_AUDIT\fR\fR
234 233 .ad
235 234 .RS 14n
236 235 The audit facility, for example, \fBauditd\fR(1M).
237 236 .RE
238 237
239 238 .sp
240 239 .ne 2
241 240 .na
242 241 \fB\fBLOG_LOCAL0\fR\fR
243 242 .ad
244 243 .RS 14n
245 244 Designated for local use.
246 245 .RE
247 246
248 247 .sp
249 248 .ne 2
250 249 .na
251 250 \fB\fBLOG_LOCAL1\fR\fR
252 251 .ad
253 252 .RS 14n
254 253 Designated for local use.
255 254 .RE
256 255
257 256 .sp
258 257 .ne 2
259 258 .na
260 259 \fB\fBLOG_LOCAL2\fR\fR
261 260 .ad
262 261 .RS 14n
263 262 Designated for local use.
264 263 .RE
265 264
266 265 .sp
267 266 .ne 2
268 267 .na
269 268 \fB\fBLOG_LOCAL3\fR\fR
270 269 .ad
271 270 .RS 14n
272 271 Designated for local use.
273 272 .RE
274 273
275 274 .sp
276 275 .ne 2
277 276 .na
278 277 \fB\fBLOG_LOCAL4\fR\fR
279 278 .ad
280 279 .RS 14n
281 280 Designated for local use.
282 281 .RE
283 282
284 283 .sp
285 284 .ne 2
286 285 .na
287 286 \fB\fBLOG_LOCAL5\fR\fR
288 287 .ad
289 288 .RS 14n
290 289 Designated for local use.
291 290 .RE
292 291
293 292 .sp
294 293 .ne 2
295 294 .na
296 295 \fB\fBLOG_LOCAL6\fR\fR
297 296 .ad
298 297 .RS 14n
299 298 Designated for local use.
300 299 .RE
301 300
302 301 .sp
303 302 .ne 2
304 303 .na
305 304 \fB\fBLOG_LOCAL7\fR\fR
306 305 .ad
307 306 .RS 14n
308 307 Designated for local use.
309 308 .RE
310 309
311 310 .sp
312 311 .LP
313 312 The \fBopenlog()\fR function sets process attributes that affect subsequent
314 313 calls to \fBsyslog()\fR. The \fIident\fR argument is a string that is prepended
315 314 to every message. The \fBopenlog()\fR function uses the passed-in \fIident\fR
316 315 argument directly, rather than making a private copy of it. The \fIlogopt\fR
317 316 argument indicates logging options. Values for \fIlogopt\fR are constructed by
318 317 a bitwise-inclusive OR of zero or more of the following:
319 318 .sp
320 319 .ne 2
321 320 .na
322 321 \fB\fBLOG_PID\fR\fR
323 322 .ad
324 323 .RS 14n
325 324 Log the process \fBID\fR with each message. This is useful for identifying
326 325 specific daemon processes (for daemons that fork).
327 326 .RE
328 327
329 328 .sp
330 329 .ne 2
331 330 .na
332 331 \fB\fBLOG_CONS\fR\fR
333 332 .ad
334 333 .RS 14n
335 334 Write messages to the system console if they cannot be sent to
336 335 \fBsyslogd\fR(1M). This option is safe to use in daemon processes that have no
337 336 controlling terminal, since \fBsyslog()\fR forks before opening the console.
338 337 .RE
339 338
340 339 .sp
341 340 .ne 2
342 341 .na
343 342 \fB\fBLOG_NDELAY\fR\fR
344 343 .ad
345 344 .RS 14n
346 345 Open the connection to \fBsyslogd\fR(1M) immediately. Normally the open is
347 346 delayed until the first message is logged. This is useful for programs that
348 347 need to manage the order in which file descriptors are allocated.
349 348 .RE
350 349
351 350 .sp
352 351 .ne 2
353 352 .na
354 353 \fB\fBLOG_ODELAY\fR\fR
355 354 .ad
356 355 .RS 14n
357 356 Delay open until \fBsyslog()\fR is called.
358 357 .RE
359 358
360 359 .sp
361 360 .ne 2
362 361 .na
363 362 \fB\fBLOG_NOWAIT\fR\fR
364 363 .ad
365 364 .RS 14n
366 365 Do not wait for child processes that have been forked to log messages onto the
367 366 console. This option should be used by processes that enable notification of
368 367 child termination using \fBSIGCHLD\fR, since \fBsyslog()\fR may otherwise block
369 368 waiting for a child whose exit status has already been collected.
370 369 .RE
371 370
372 371 .sp
373 372 .LP
374 373 The \fIfacility\fR argument encodes a default facility to be assigned to all
375 374 messages that do not have an explicit facility already encoded. The initial
376 375 default facility is \fBLOG_USER\fR.
377 376 .sp
378 377 .LP
379 378 The \fBopenlog()\fR and \fBsyslog()\fR functions may allocate a file
380 379 descriptor. It is not necessary to call \fBopenlog()\fR prior to calling
381 380 \fBsyslog()\fR.
382 381 .sp
383 382 .LP
384 383 The \fBcloselog()\fR function closes any open file descriptors allocated by
385 384 previous calls to \fBopenlog()\fR or \fBsyslog()\fR.
386 385 .sp
↓ open down ↓ |
196 lines elided |
↑ open up ↑ |
387 386 .LP
388 387 The \fBsetlogmask()\fR function sets the log priority mask for the current
389 388 process to \fImaskpri\fR and returns the previous mask. If the \fImaskpri\fR
390 389 argument is 0, the current log mask is not modified. Calls by the current
391 390 process to \fBsyslog()\fR with a priority not set in \fImaskpri\fR are
392 391 rejected. The mask for an individual priority \fIpri\fR is calculated by the
393 392 macro \fBLOG_MASK(\fIpri\fR)\fR; the mask for all priorities up to and
394 393 including \fItoppri\fR is given by the macro \fBLOG_UPTO(\fItoppri\fR)\fR. The
395 394 default log mask allows all priorities to be logged.
396 395 .SH RETURN VALUES
397 -.sp
398 396 .LP
399 397 The \fBsetlogmask()\fR function returns the previous log priority mask. The
400 398 \fBcloselog()\fR, \fBopenlog()\fR and \fBsyslog()\fR functions return no value.
401 399 .SH ERRORS
402 -.sp
403 400 .LP
404 401 No errors are defined.
405 402 .SH EXAMPLES
406 403 .LP
407 404 \fBExample 1 \fRExample of \fBLOG_ALERT\fR message.
408 405 .sp
409 406 .LP
410 407 This call logs a message at priority \fBLOG_ALERT\fR:
411 408
412 409 .sp
413 410 .in +2
414 411 .nf
415 412 \fBsyslog(LOG_ALERT, "who: internal error 23")\fR;
416 413 .fi
417 414 .in -2
418 415 .sp
419 416
420 417 .sp
421 418 .LP
422 419 The \fBFTP\fR daemon \fBftpd\fR would make this call to \fBopenlog()\fR to
423 420 indicate that all messages it logs should have an identifying string of
424 421 \fBftpd\fR, should be treated by \fBsyslogd\fR(1M) as other messages from
425 422 system daemons are, should include the process \fBID\fR of the process logging
426 423 the message:
427 424
428 425 .sp
429 426 .in +2
430 427 .nf
431 428 \fBopenlog("ftpd", LOG_PID, LOG_DAEMON)\fR;
432 429 .fi
433 430 .in -2
434 431 .sp
435 432
436 433 .sp
437 434 .LP
438 435 Then it would make the following call to \fBsetlogmask()\fR to indicate that
439 436 messages at priorities from \fBLOG_EMERG\fR through \fBLOG_ERR\fR should be
440 437 logged, but that no messages at any other priority should be logged:
441 438
442 439 .sp
443 440 .in +2
444 441 .nf
445 442 \fBsetlogmask(LOG_UPTO(LOG_ERR))\fR;
446 443 .fi
447 444 .in -2
448 445 .sp
449 446
450 447 .sp
451 448 .LP
452 449 Then, to log a message at priority \fBLOG_INFO\fR, it would make the following
453 450 call to \fBsyslog\fR:
454 451
455 452 .sp
456 453 .in +2
457 454 .nf
458 455 \fBsyslog(LOG_INFO, "Connection from host %d", CallingHost)\fR;
459 456 .fi
460 457 .in -2
461 458 .sp
462 459
463 460 .sp
464 461 .LP
465 462 A locally-written utility could use the following call to \fBsyslog()\fR to log
466 463 a message at priority \fBLOG_INFO\fR to be treated by \fBsyslogd\fR(1M) as
467 464 other messages to the facility \fBLOG_LOCAL2\fR are:
↓ open down ↓ |
55 lines elided |
↑ open up ↑ |
468 465
469 466 .sp
470 467 .in +2
471 468 .nf
472 469 \fBsyslog(LOG_INFO|LOG_LOCAL2, "error: %m")\fR;
473 470 .fi
474 471 .in -2
475 472 .sp
476 473
477 474 .SH ATTRIBUTES
478 -.sp
479 475 .LP
480 476 See \fBattributes\fR(5) for descriptions of the following attributes:
481 477 .sp
482 478
483 479 .sp
484 480 .TS
485 481 box;
486 482 c | c
487 483 l | l .
488 484 ATTRIBUTE TYPE ATTRIBUTE VALUE
489 485 _
490 486 Interface Stability Committed
491 487 _
492 488 MT-Level Safe
493 489 _
494 490 Standard See \fBstandards\fR(5).
495 491 .TE
496 492
497 493 .SH SEE ALSO
498 -.sp
499 494 .LP
500 495 \fBat\fR(1), \fBcrontab\fR(1), \fBlogger\fR(1), \fBlogin\fR(1), \fBlpc\fR(1B),
501 496 \fBlpr\fR(1B), \fBauditd\fR(1M), \fBcron\fR(1M), \fBgetty\fR(1M),
502 -\fBin.ftpd\fR(1M), \fBsu\fR(1M), \fBsyslogd\fR(1M), \fBprintf\fR(3UCB),
497 +\fBsu\fR(1M), \fBsyslogd\fR(1M), \fBprintf\fR(3UCB),
503 498 \fBsyslog.conf\fR(4), \fBattributes\fR(5), \fBstandards\fR(5)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX