Import Debian changes 0.66.4-9
[hcoop/debian/courier-authlib.git] / liblog / courierlogger.html
CommitLineData
d9898ee8 1<?xml version="1.0"?>
b0322a85 2<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><title>courierlogger</title><link rel="stylesheet" type="text/css" href="style.css"/><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"/><link rel="home" href="#courierlogger" title="courierlogger"/><link xmlns="" rel="stylesheet" type="text/css" href="manpage.css"/><meta xmlns="" name="MSSmartTagsPreventParsing" content="TRUE"/><link xmlns="" rel="icon" href="icon.gif" type="image/gif"/><!--
d9898ee8 3
b0322a85 4Copyright 1998 - 2009 Double Precision, Inc. See COPYING for distribution
d9898ee8 5information.
6
b0322a85 7--></head><body><div class="refentry"><a id="courierlogger" shape="rect"> </a><div class="titlepage"/><div class="refnamediv"><h2>Name</h2><p>courierlogger — Courier syslog wrapper</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">courierlogger</code> [-name=<em class="replaceable"><code>title</code></em>] [-facility=<em class="replaceable"><code>subsystem</code></em>] [-pid=<em class="replaceable"><code>filename</code></em>] [-user=<em class="replaceable"><code>user</code></em>] [-group=<em class="replaceable"><code>group</code></em>] [-droproot] [[[-respawn] [-start]
d50284c4 8 <em class="replaceable"><code>program</code></em> [argument...]] | [-stop] | [-restart]]</p></div></div><div class="refsect1"><a id="idm255241698272" shape="rect"> </a><h2>DESCRIPTION</h2><p>
8d138742 9<span class="command"><strong>courierlogger</strong></span>
d9898ee8 10is a wrapper that captures
11another process's error messages, and forwards them
12to the system logging facility,
b0322a85 13<span class="quote">“<span class="quote">syslog</span>”</span>.</p><p>
d9898ee8 14There are two ways to use courierlogger:
b0322a85 15</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
d9898ee8 16Use the shell to pipe another command's standard error, and/or its standard
17output, to
b0322a85 18<span class="command"><strong>courierlogger</strong></span>'s standard input.</p></li><li class="listitem"><p>
d9898ee8 19Alternatively,
8d138742 20<span class="command"><strong>courierlogger</strong></span>
d9898ee8 21itself can start another process, and arrange to have its standard error
22captured.</p></li></ol></div><p>
23 </p><p>
d50284c4 24In either case, each read line of text is sent as a syslog message.</p></div><div class="refsect1"><a id="idm255244818160" shape="rect"> </a><h2>OPTIONS</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">-name=<em class="replaceable"><code>title</code></em></span></dt><dd><p>
d9898ee8 25Use <em class="replaceable"><code>title</code></em> for sending messages to syslog.
26<em class="replaceable"><code>title</code></em> should be the application's name.</p></dd><dt><span class="term">-facility=<em class="replaceable"><code>subsystem</code></em></span></dt><dd><p>
27Use <em class="replaceable"><code>subsystem</code></em> for classifying messages.
28Your syslog facility uses <em class="replaceable"><code>subsystem</code></em> to determine
29which log messages are recorded in which log files.
b0322a85 30The currently defined subsystems are:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><code class="literal">auth</code></p></li><li class="listitem"><p><code class="literal">authpriv</code></p></li><li class="listitem"><p><code class="literal">console</code></p></li><li class="listitem"><p><code class="literal">cron</code></p></li><li class="listitem"><p><code class="literal">daemon</code></p></li><li class="listitem"><p><code class="literal">ftp</code></p></li><li class="listitem"><p><code class="literal">kern</code></p></li><li class="listitem"><p><code class="literal">lpr</code></p></li><li class="listitem"><p><code class="literal">mail</code></p></li><li class="listitem"><p><code class="literal">news</code></p></li><li class="listitem"><p><code class="literal">security</code></p></li><li class="listitem"><p><code class="literal">user</code></p></li><li class="listitem"><p><code class="literal">uucp</code></p></li><li class="listitem"><p><code class="literal">local0</code></p></li><li class="listitem"><p><code class="literal">local1</code></p></li><li class="listitem"><p><code class="literal">local2</code></p></li><li class="listitem"><p><code class="literal">local3</code></p></li><li class="listitem"><p><code class="literal">local4</code></p></li><li class="listitem"><p><code class="literal">local5</code></p></li><li class="listitem"><p><code class="literal">local6</code></p></li><li class="listitem"><p><code class="literal">local7</code></p></li></ul></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
d9898ee8 31Not all of the above facility names are implemented on every system.
32Check your system's syslog documentation for information on which facility
33names are allowed, and which log files record the corresponding messages
34for each facility.</p></div></dd><dt><span class="term">-pid=<em class="replaceable"><code>filename</code></em></span></dt><dd><p>
8d138742 35Save <span class="command"><strong>courierlogger</strong></span>'s
d9898ee8 36process ID in <em class="replaceable"><code>filename</code></em>.
37The <em class="parameter"><code>-pid</code></em> option is required when
38<em class="parameter"><code>-start</code></em>,
39<em class="parameter"><code>-stop</code></em>,
40<em class="parameter"><code>-restart</code></em> are given. If <em class="parameter"><code>-pid</code></em>
41is given without any of these, <em class="parameter"><code>-start</code></em> is assumed.</p></dd><dt><span class="term">-start</span></dt><dd><p>
42Run as a daemon. The <code class="option">pid</code> option is required.
8d138742
CE
43<span class="command"><strong>courierlogger</strong></span> will quietly terminate if another
44<span class="command"><strong>courierlogger</strong></span> process is already running.
d9898ee8 45This is used to make sure that only one instance of
46<code class="filename">program</code> is running at the same time.
47Specify a different filename with <code class="option">pid</code> to start a second
48copy of <code class="filename">program</code>.</p></dd><dt><span class="term">-respawn</span></dt><dd><p>
49Restart <code class="filename">program</code> if it terminates.
50Normally
8d138742 51<span class="command"><strong>courierlogger</strong></span> itself will terminate when
d9898ee8 52<code class="filename">program</code> finishes running.
53Use <code class="option">respawn</code> to restart it instead.</p></dd><dt><span class="term">-restart</span></dt><dd><p>
54Send a <code class="literal">SIGHUP</code> signal to the courierlogger process
55(as determined by examining the contents of the file specified by
56<code class="option">pid</code>), which will in turn send a <code class="literal">SIGHUP</code>
57to its child <code class="filename">program</code>.
58Does nothing if courierlogger is not running.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
59<code class="filename">program</code> must be originally started with the
60<code class="option">respawn</code> option if sending it a <code class="literal">SIGHUP</code>
61causes it to terminate.</p></div><p>
62The same thing may be accomplished by sending <code class="literal">SIGHUP</code>
8d138742 63to <span class="command"><strong>courierlogger</strong></span> itself.</p></dd><dt><span class="term">-stop</span></dt><dd><p>
d9898ee8 64Send a <code class="literal">SIGTERM</code> signal to courierlogger, which in turn
65forwards it on to <code class="filename">program</code>.
66If <code class="filename">program</code> does not terminate in 8 seconds, kill it
67with <code class="literal">SIGKILL</code>.</p></dd><dt><span class="term">-user=<em class="replaceable"><code>user</code></em>, -group=<em class="replaceable"><code>group</code></em></span></dt><dd><p>
68If running as root, change credentials to the given user and/or group, which
69may be given as names or numeric ids.</p><p>When running a child program, it is started
70<span class="emphasis"><em>before</em></span> privileges are dropped
71(unless the <code class="option">-droproot</code> option is also given).
72This gives a means of
73starting a child as root so it can bind to a privileged port, but still have
74courierlogger run as a non-root user. For the <code class="option">-stop</code> and
75<code class="option">-restart</code> options to work, you should configure the child
76program to drop its privileges to the same userid too.</p></dd><dt><span class="term">-droproot</span></dt><dd><p>
77Drop root privileges before starting the child process.
78The <code class="option">-user</code> and <code class="option">-group</code> options specify
79the non-privileges userid and groupid.
80Without the <code class="option">-droproot</code> option the child process remains
8d138742 81a root process, and only the parent <span class="command"><strong>courierlogger</strong></span>
d9898ee8 82process drops root privileges.</p></dd><dt><span class="term"><em class="replaceable"><code>program</code></em> [ argument ] ... </span></dt><dd><p>
83If a program is given <code class="filename">program</code>
84will be started as a child process of
8d138742
CE
85<span class="command"><strong>courierlogger</strong></span>, capturing its standard error.
86Otherwise, <span class="command"><strong>courierlogger</strong></span>
d9898ee8 87reads message from standard input, and automatically terminates when
d50284c4 88standard input is closed.</p></dd></dl></div></div><div class="refsect1"><a id="idm255239466800" shape="rect"> </a><h2>SEE ALSO</h2><p>
8d138742 89<a class="ulink" href="couriertcpd.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">couriertcpd</span>(1)</span></a>, your syslog man page.</p></div></div></body></html>