chiark / gitweb /
man: document that machinectl set-limit creates a btrfs loopback too
[elogind.git] / man / systemd-journald.service.xml
1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3   "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4
5 <!--
6   This file is part of systemd.
7
8   Copyright 2010 Lennart Poettering
9
10   systemd is free software; you can redistribute it and/or modify it
11   under the terms of the GNU Lesser General Public License as published by
12   the Free Software Foundation; either version 2.1 of the License, or
13   (at your option) any later version.
14
15   systemd is distributed in the hope that it will be useful, but
16   WITHOUT ANY WARRANTY; without even the implied warranty of
17   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18   Lesser General Public License for more details.
19
20   You should have received a copy of the GNU Lesser General Public License
21   along with systemd; If not, see <http://www.gnu.org/licenses/>.
22 -->
23
24 <refentry id="systemd-journald.service">
25
26   <refentryinfo>
27     <title>systemd-journald.service</title>
28     <productname>systemd</productname>
29
30     <authorgroup>
31       <author>
32         <contrib>Developer</contrib>
33         <firstname>Lennart</firstname>
34         <surname>Poettering</surname>
35         <email>lennart@poettering.net</email>
36       </author>
37     </authorgroup>
38   </refentryinfo>
39
40   <refmeta>
41     <refentrytitle>systemd-journald.service</refentrytitle>
42     <manvolnum>8</manvolnum>
43   </refmeta>
44
45   <refnamediv>
46     <refname>systemd-journald.service</refname>
47     <refname>systemd-journald.socket</refname>
48     <refname>systemd-journald-dev-log.socket</refname>
49     <refname>systemd-journald</refname>
50     <refpurpose>Journal service</refpurpose>
51   </refnamediv>
52
53   <refsynopsisdiv>
54     <para><filename>systemd-journald.service</filename></para>
55     <para><filename>systemd-journald.socket</filename></para>
56     <para><filename>systemd-journald-dev-log.socket</filename></para>
57     <para><filename>/usr/lib/systemd/systemd-journald</filename></para>
58   </refsynopsisdiv>
59
60   <refsect1>
61     <title>Description</title>
62
63     <para><filename>systemd-journald</filename> is a system service
64     that collects and stores logging data. It creates and maintains
65     structured, indexed journals based on logging information that is
66     received from a variety of sources:</para>
67
68     <itemizedlist>
69       <listitem><para>Kernel log messages, via kmsg</para></listitem>
70
71       <listitem><para>Simple system log messages, via the libc
72       <citerefentry project='man-pages'><refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry>
73       call</para></listitem>
74
75       <listitem><para>Structured system log messages via the native
76       Journal API, see
77       <citerefentry><refentrytitle>sd_journal_print</refentrytitle><manvolnum>4</manvolnum></citerefentry></para></listitem>
78
79       <listitem><para>Standard output and standard error of system
80       services</para></listitem>
81
82       <listitem><para>Audit records, via the audit
83       subsystem</para></listitem>
84     </itemizedlist>
85
86     <para>The daemon will implicitly collect numerous metadata fields
87     for each log messages in a secure and unfakeable way. See
88     <citerefentry><refentrytitle>systemd.journal-fields</refentrytitle><manvolnum>7</manvolnum></citerefentry>
89     for more information about the collected metadata.
90     </para>
91
92     <para>Log data collected by the journal is primarily text-based
93     but can also include binary data where necessary. All objects
94     stored in the journal can be up to 2^64-1 bytes in size.</para>
95
96     <para>By default, the journal stores log data in
97     <filename>/run/log/journal/</filename>. Since
98     <filename>/run/</filename> is volatile, log data is lost at
99     reboot. To make the data persistent, it is sufficient to create
100     <filename>/var/log/journal/</filename> where
101     <filename>systemd-journald</filename> will then store the
102     data.</para>
103
104     <para><filename>systemd-journald</filename> will forward all
105     received log messages to the
106     <constant>AF_UNIX</constant>/<constant>SOCK_DGRAM</constant>
107     socket <filename>/run/systemd/journal/syslog</filename>, if it
108     exists, which may be used by Unix syslog daemons to process the
109     data further.</para>
110
111     <para>See
112     <citerefentry><refentrytitle>journald.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
113     for information about the configuration of this service.</para>
114   </refsect1>
115
116   <refsect1>
117     <title>Signals</title>
118
119     <variablelist>
120       <varlistentry>
121         <term>SIGUSR1</term>
122
123         <listitem><para>Request that journal data from
124         <filename>/run/</filename> is flushed to
125         <filename>/var/</filename> in order to make it persistent (if
126         this is enabled). This must be used after
127         <filename>/var/</filename> is mounted, as otherwise log data
128         from <filename>/run</filename> is never flushed to
129         <filename>/var</filename> regardless of the
130         configuration.</para></listitem>
131       </varlistentry>
132
133       <varlistentry>
134         <term>SIGUSR2</term>
135
136         <listitem><para>Request immediate rotation of the journal
137         files.</para></listitem>
138       </varlistentry>
139     </variablelist>
140   </refsect1>
141
142   <refsect1>
143     <title>Kernel Command Line</title>
144
145     <para>A few configuration parameters from
146     <filename>journald.conf</filename> may be overridden on the kernel
147     command line:</para>
148
149     <variablelist class='kernel-commandline-options'>
150       <varlistentry>
151         <term><varname>systemd.journald.forward_to_syslog=</varname></term>
152         <term><varname>systemd.journald.forward_to_kmsg=</varname></term>
153         <term><varname>systemd.journald.forward_to_console=</varname></term>
154         <term><varname>systemd.journald.forward_to_wall=</varname></term>
155
156         <listitem><para>Enables/disables forwarding of collected log
157         messages to syslog, the kernel log buffer, the system console
158         or wall.
159         </para>
160
161         <para>See
162         <citerefentry><refentrytitle>journald.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
163         for information about these settings.</para>
164         </listitem>
165
166       </varlistentry>
167     </variablelist>
168   </refsect1>
169
170   <refsect1>
171     <title>Access Control</title>
172
173     <para>Journal files are, by default, owned and readable by the
174     <literal>systemd-journal</literal> system group but are not
175     writable. Adding a user to this group thus enables her/him to read
176     the journal files.</para>
177
178     <para>By default, each logged in user will get her/his own set of
179     journal files in <filename>/var/log/journal/</filename>. These
180     files will not be owned by the user, however, in order to avoid
181     that the user can write to them directly. Instead, file system
182     ACLs are used to ensure the user gets read access only.</para>
183
184     <para>Additional users and groups may be granted access to journal
185     files via file system access control lists (ACL). Distributions
186     and administrators may choose to grant read access to all members
187     of the <literal>wheel</literal> and <literal>adm</literal> system
188     groups with a command such as the following:</para>
189
190     <programlisting># setfacl -Rnm g:wheel:rx,d:g:wheel:rx,g:adm:rx,d:g:adm:rx /var/log/journal/</programlisting>
191
192     <para>Note that this command will update the ACLs both for
193     existing journal files and for future journal files created in the
194     <filename>/var/log/journal/</filename> directory.</para>
195   </refsect1>
196
197   <refsect1>
198     <title>Files</title>
199
200     <variablelist>
201       <varlistentry>
202         <term><filename>/etc/systemd/journald.conf</filename></term>
203
204         <listitem><para>Configure
205         <command>systemd-journald</command>
206         behaviour. See
207         <citerefentry><refentrytitle>journald.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
208         </para></listitem>
209       </varlistentry>
210
211       <varlistentry>
212         <term><filename>/run/log/journal/<replaceable>machine-id</replaceable>/*.journal</filename></term>
213         <term><filename>/run/log/journal/<replaceable>machine-id</replaceable>/*.journal~</filename></term>
214         <term><filename>/var/log/journal/<replaceable>machine-id</replaceable>/*.journal</filename></term>
215         <term><filename>/var/log/journal/<replaceable>machine-id</replaceable>/*.journal~</filename></term>
216
217         <listitem><para><command>systemd-journald</command> writes
218         entries to files in
219         <filename>/run/log/journal/<replaceable>machine-id</replaceable>/</filename>
220         or
221         <filename>/var/log/journal/<replaceable>machine-id</replaceable>/</filename>
222         with the <literal>.journal</literal> suffix. If the daemon is
223         stopped uncleanly, or if the files are found to be corrupted,
224         they are renamed using the <literal>.journal~</literal>
225         suffix, and <command>systemd-journald</command> starts writing
226         to a new file. <filename>/run</filename> is used when
227         <filename>/var/log/journal</filename> is not available, or
228         when <option>Storage=volatile</option> is set in the
229         <citerefentry><refentrytitle>journald.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
230         configuration file. </para></listitem>
231       </varlistentry>
232     </variablelist>
233   </refsect1>
234
235   <refsect1>
236     <title>See Also</title>
237     <para>
238       <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
239       <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
240       <citerefentry><refentrytitle>journald.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
241       <citerefentry><refentrytitle>systemd.journal-fields</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
242       <citerefentry><refentrytitle>sd-journal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
243       <citerefentry><refentrytitle>systemd-coredump</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
244       <citerefentry><refentrytitle>setfacl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
245       <citerefentry><refentrytitle>sd_journal_print</refentrytitle><manvolnum>4</manvolnum></citerefentry>,
246       <command>pydoc systemd.journal</command>.
247     </para>
248   </refsect1>
249
250 </refentry>