1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00
systemd/man/journal-upload.conf.xml
Štěpán Němec a07693cda5 man: fix incorrect volume numbers in internal man page references
Some ambiguity (e.g., same-named man pages in multiple volumes)
makes it impossible to fully automate this, but the following
Python snippet (run inside the man/ directory of the systemd repo)
helped to generate the sed command lines (which were subsequently
manually reviewed, run and the false positives reverted):

from pathlib import Path

import lxml
from lxml import etree as ET

man2vol: dict[str, str] = {}
man2citerefs: dict[str, list] = {}

for file in Path(".").glob("*.xml"):
    tree = ET.parse(file, lxml.etree.XMLParser(recover=True))
    meta = tree.find("refmeta")
    if meta is not None:
        title = meta.findtext("refentrytitle")
        if title is not None:
            vol = meta.findtext("manvolnum")
            if vol is not None:
                man2vol[title] = vol
            citerefs = list(tree.iter("citerefentry"))
            if citerefs:
                man2citerefs[title] = citerefs

for man, refs in man2citerefs.items():
    for ref in refs:
        title = ref.findtext("refentrytitle")
        if title is not None:
            has = ref.findtext("manvolnum")
            try:
                should_have = man2vol[title]
            except KeyError:  # Non-systemd man page reference?  Ignore.
                continue
            if has != should_have:
                print(
                    f"sed -i '\\|<citerefentry><refentrytitle>{title}"
                    f"</refentrytitle><manvolnum>{has}</manvolnum>"
                    f"</citerefentry>|s|<manvolnum>{has}</manvolnum>|"
                    f"<manvolnum>{should_have}</manvolnum>|' {man}.xml"
                )

(cherry picked from commit 597c6cc119)
2024-11-13 19:48:10 +00:00

114 lines
4.3 KiB
XML

<?xml version='1.0'?> <!--*-nxml-*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
<refentry id="journal-upload.conf" conditional='HAVE_MICROHTTPD'
xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>journal-upload.conf</title>
<productname>systemd</productname>
</refentryinfo>
<refmeta>
<refentrytitle>journal-upload.conf</refentrytitle>
<manvolnum>5</manvolnum>
</refmeta>
<refnamediv>
<refname>journal-upload.conf</refname>
<refname>journal-upload.conf.d</refname>
<refpurpose>Configuration files for the journal upload service</refpurpose>
</refnamediv>
<refsynopsisdiv>
<para><filename>/etc/systemd/journal-upload.conf</filename></para>
<para><filename>/run/systemd/journal-upload.conf</filename></para>
<para><filename>/usr/lib/systemd/journal-upload.conf</filename></para>
<para><filename>/etc/systemd/journal-upload.conf.d/*.conf</filename></para>
<para><filename>/run/systemd/journal-upload.conf.d/*.conf</filename></para>
<para><filename>/usr/lib/systemd/journal-upload.conf.d/*.conf</filename></para>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>These files configure various parameters of
<citerefentry><refentrytitle>systemd-journal-upload.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
See
<citerefentry><refentrytitle>systemd.syntax</refentrytitle><manvolnum>7</manvolnum></citerefentry>
for a general description of the syntax.</para>
</refsect1>
<xi:include href="standard-conf.xml" xpointer="main-conf" />
<refsect1>
<title>Options</title>
<para>All options are configured in the [Upload] section:</para>
<variablelist class='config-directives'>
<varlistentry>
<term><varname>URL=</varname></term>
<listitem><para>The URL to upload the journal entries to. See the description
of <option>--url=</option> option in
<citerefentry><refentrytitle>systemd-journal-upload</refentrytitle><manvolnum>8</manvolnum></citerefentry>
for the description of possible values. There is no default value, so either this
option or the command-line option must be always present to make an upload.</para>
<xi:include href="version-info.xml" xpointer="v232"/></listitem>
</varlistentry>
<varlistentry>
<term><varname>ServerKeyFile=</varname></term>
<listitem><para>SSL key in PEM format.</para>
<xi:include href="version-info.xml" xpointer="v232"/></listitem>
</varlistentry>
<varlistentry>
<term><varname>ServerCertificateFile=</varname></term>
<listitem><para>SSL CA certificate in PEM format.</para>
<xi:include href="version-info.xml" xpointer="v232"/></listitem>
</varlistentry>
<varlistentry>
<term><varname>TrustedCertificateFile=</varname></term>
<listitem><para>SSL CA certificate.</para>
<xi:include href="version-info.xml" xpointer="v232"/></listitem>
</varlistentry>
<varlistentry>
<term><varname>NetworkTimeoutSec=</varname></term>
<listitem><para>When network connectivity to the server is lost, this option
configures the time to wait for the connectivity to get restored. If the server is
not reachable over the network for the configured time, <command>systemd-journal-upload</command>
exits. Takes a value in seconds (or in other time units if suffixed with "ms", "min", "h", etc).
For details, see <citerefentry><refentrytitle>systemd.time</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
</para>
<xi:include href="version-info.xml" xpointer="v249"/></listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>See Also</title>
<para><simplelist type="inline">
<member><citerefentry><refentrytitle>systemd-journal-upload.service</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
<member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
<member><citerefentry><refentrytitle>systemd-journald.service</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
</simplelist></para>
</refsect1>
</refentry>