man: always place <programlisting> and </programlisting> in a line with actual sources, so that we don't get spurious newlines in the man page output

This commit is contained in:
Lennart Poettering 2014-02-14 15:56:19 +01:00
parent 6046278f40
commit 9fccdb0f64
13 changed files with 47 additions and 99 deletions

View File

@ -777,8 +777,7 @@ AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitd
[with_systemdsystemunitdir=$def_systemdsystemunitdir])]) [with_systemdsystemunitdir=$def_systemdsystemunitdir])])
AS_IF([test "x$with_systemdsystemunitdir" != "xno"], AS_IF([test "x$with_systemdsystemunitdir" != "xno"],
[AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])]) [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])
AM_CONDITIONAL(HAVE_SYSTEMD, [test "x$with_systemdsystemunitdir" != "xno"]) AM_CONDITIONAL(HAVE_SYSTEMD, [test "x$with_systemdsystemunitdir" != "xno"])</programlisting>
</programlisting>
<para>This snippet allows automatic <para>This snippet allows automatic
installation of the unit files on systemd installation of the unit files on systemd

View File

@ -90,9 +90,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<filename>/usr/lib/kernel/install.d/*.install</filename> and <filename>/usr/lib/kernel/install.d/*.install</filename> and
<filename>/etc/kernel/install.d/*.install</filename> with <filename>/etc/kernel/install.d/*.install</filename> with
the arguments the arguments
<programlisting> <programlisting>add <replaceable>KERNEL-VERSION</replaceable> <filename>/boot/<replaceable>MACHINE-ID</replaceable>/<replaceable>KERNEL-VERSION</replaceable>/</filename></programlisting>
add <replaceable>KERNEL-VERSION</replaceable> <filename>/boot/<replaceable>MACHINE-ID</replaceable>/<replaceable>KERNEL-VERSION</replaceable>/</filename>
</programlisting>
</para> </para>
<para>The kernel-install plugin <filename>50-depmod.install</filename> runs depmod for the <replaceable>KERNEL-VERSION</replaceable>.</para> <para>The kernel-install plugin <filename>50-depmod.install</filename> runs depmod for the <replaceable>KERNEL-VERSION</replaceable>.</para>
@ -114,9 +112,7 @@ add <replaceable>KERNEL-VERSION</replaceable> <filename>/boot/<replaceable>MACHI
<listitem> <listitem>
<para>Calls every executable <filename>/usr/lib/kernel/install.d/*.install</filename> <para>Calls every executable <filename>/usr/lib/kernel/install.d/*.install</filename>
and <filename>/etc/kernel/install.d/*.install</filename> with the arguments and <filename>/etc/kernel/install.d/*.install</filename> with the arguments
<programlisting> <programlisting>remove <replaceable>KERNEL-VERSION</replaceable> <filename>/boot/<replaceable>MACHINE-ID</replaceable>/<replaceable>KERNEL-VERSION</replaceable>/</filename></programlisting>
remove <replaceable>KERNEL-VERSION</replaceable> <filename>/boot/<replaceable>MACHINE-ID</replaceable>/<replaceable>KERNEL-VERSION</replaceable>/</filename>
</programlisting>
</para> </para>
<para><command>kernel-install</command> removes the entire directory <para><command>kernel-install</command> removes the entire directory

View File

@ -86,8 +86,7 @@
<refsect1> <refsect1>
<title>Example</title> <title>Example</title>
<programlisting> <programlisting># /etc/nsswitch.conf
# /etc/nsswitch.conf
passwd: compat passwd: compat
group: compat group: compat
@ -101,20 +100,17 @@ services: db files
ethers: db files ethers: db files
rpc: db files rpc: db files
netgroup: nis netgroup: nis</programlisting>
</programlisting>
<para>To test, use <command>glibc</command>'s <command>getent</command> tool:</para> <para>To test, use <command>glibc</command>'s <command>getent</command> tool:</para>
<programlisting> <programlisting>$ getent ahosts `hostname`
$ getent ahosts `hostname`
::1 STREAM omega ::1 STREAM omega
::1 DGRAM ::1 DGRAM
::1 RAW ::1 RAW
127.0.0.2 STREAM 127.0.0.2 STREAM
127.0.0.2 DGRAM 127.0.0.2 DGRAM
127.0.0.2 RAW 127.0.0.2 RAW</programlisting>
</programlisting>
<para>In this case the local hostname is <varname>omega</varname>.</para> <para>In this case the local hostname is <varname>omega</varname>.</para>

View File

@ -330,8 +330,7 @@ int wait_for_changes(sd_journal *j) {
pollfd.events = sd_journal_get_events(j); pollfd.events = sd_journal_get_events(j);
poll(&amp;pollfd, 1, msec); poll(&amp;pollfd, 1, msec);
return sd_journal_process(j); return sd_journal_process(j);
} }</programlisting>
</programlisting>
</refsect1> </refsect1>
<refsect1> <refsect1>

View File

@ -555,8 +555,7 @@ LISTEN UNIT ACTIVATES
[::]:22 sshd.socket sshd.service [::]:22 sshd.socket sshd.service
kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
5 sockets listed. 5 sockets listed.</programlisting>
</programlisting>
Note: because the addresses might contains spaces, this output Note: because the addresses might contains spaces, this output
is not suitable for programmatic consumption. is not suitable for programmatic consumption.
</para> </para>

View File

@ -204,20 +204,16 @@
<title>Examples</title> <title>Examples</title>
<para>To see all local configuration:</para> <para>To see all local configuration:</para>
<programlisting>systemd-delta <programlisting>systemd-delta</programlisting>
</programlisting>
<para>To see all runtime configuration:</para> <para>To see all runtime configuration:</para>
<programlisting>systemd-delta /run <programlisting>systemd-delta /run</programlisting>
</programlisting>
<para>To see all system unit configuration changes:</para> <para>To see all system unit configuration changes:</para>
<programlisting>systemd-delta systemd/system <programlisting>systemd-delta systemd/system</programlisting>
</programlisting>
<para>To see all runtime "drop-in" changes for system units:</para> <para>To see all runtime "drop-in" changes for system units:</para>
<programlisting>systemd-delta --type=extended /run/systemd/system <programlisting>systemd-delta --type=extended /run/systemd/system</programlisting>
</programlisting>
</refsect1> </refsect1>
<refsect1> <refsect1>

View File

@ -154,14 +154,12 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<listitem><para>Return a JSON structure describing the machine.</para> <listitem><para>Return a JSON structure describing the machine.</para>
<para>Example: <para>Example:
<programlisting> <programlisting>{ "machine_id" : "8cf7ed9d451ea194b77a9f118f3dc446",
{ "machine_id" : "8cf7ed9d451ea194b77a9f118f3dc446",
"boot_id" : "3d3c9efaf556496a9b04259ee35df7f7", "boot_id" : "3d3c9efaf556496a9b04259ee35df7f7",
"hostname" : "fedora", "hostname" : "fedora",
"os_pretty_name" : "Fedora 19 (Rawhide)", "os_pretty_name" : "Fedora 19 (Rawhide)",
"virtualization" : "kvm", "virtualization" : "kvm",
...} ...}</programlisting>
</programlisting>
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@ -295,16 +293,12 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
in <ulink in <ulink
url="http://www.freedesktop.org/wiki/Software/systemd/export">Journal url="http://www.freedesktop.org/wiki/Software/systemd/export">Journal
Export Format</ulink>: Export Format</ulink>:
<programlisting> <programlisting>curl --silent -H'Accept: application/vnd.fdo.journal' \
curl --silent -H'Accept: application/vnd.fdo.journal' \ 'http://localhost:19531/entries?boot'</programlisting>
'http://localhost:19531/entries?boot'
</programlisting>
</para> </para>
<para>Listen for core dumps: <para>Listen for core dumps:
<programlisting> <programlisting>curl 'http://localhost:19531/entries?follow&amp;MESSAGE_ID=fc2e22bc6ee647b6b90729ab34a250b1'</programlisting></para>
curl 'http://localhost:19531/entries?follow&amp;MESSAGE_ID=fc2e22bc6ee647b6b90729ab34a250b1'
</programlisting></para>
</refsect1> </refsect1>
<refsect1> <refsect1>

View File

@ -230,8 +230,7 @@ Sep 08 07:37:21 bupkis systemd[1]: Starting /usr/bin/env...
Sep 08 07:37:21 bupkis systemd[1]: Started /usr/bin/env. Sep 08 07:37:21 bupkis systemd[1]: Started /usr/bin/env.
Sep 08 07:37:21 bupkis env[19948]: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin Sep 08 07:37:21 bupkis env[19948]: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
Sep 08 07:37:21 bupkis env[19948]: LANG=en_US.UTF-8 Sep 08 07:37:21 bupkis env[19948]: LANG=en_US.UTF-8
Sep 08 07:37:21 bupkis env[19948]: BOOT_IMAGE=/vmlinuz-3.11.0-0.rc5.git6.2.fc20.x86_64 Sep 08 07:37:21 bupkis env[19948]: BOOT_IMAGE=/vmlinuz-3.11.0-0.rc5.git6.2.fc20.x86_64</programlisting>
</programlisting>
</refsect1> </refsect1>
<refsect1> <refsect1>

View File

@ -160,10 +160,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<para>Example: to exploit the <quote>freeze</quote> mode added <para>Example: to exploit the <quote>freeze</quote> mode added
in Linux 3.9, one can use <command>systemctl suspend</command> in Linux 3.9, one can use <command>systemctl suspend</command>
with with
<programlisting> <programlisting>[Sleep]
[Sleep] SuspendState=freeze</programlisting></para>
SuspendState=freeze
</programlisting></para>
</refsect1> </refsect1>
<refsect1> <refsect1>

View File

@ -113,26 +113,22 @@
and no namespace isolation.</para> and no namespace isolation.</para>
<example> <example>
<title>proxy-to-nginx.socket</title> <title>proxy-to-nginx.socket</title>
<programlisting> <programlisting><![CDATA[[Socket]
<![CDATA[[Socket]
ListenStream=80 ListenStream=80
[Install] [Install]
WantedBy=sockets.target]]> WantedBy=sockets.target]]></programlisting>
</programlisting>
</example> </example>
<example> <example>
<title>proxy-to-nginx.service</title> <title>proxy-to-nginx.service</title>
<programlisting> <programlisting><![CDATA[[Unit]
<![CDATA[[Unit]
Requires=nginx.service Requires=nginx.service
After=nginx.service After=nginx.service
[Service] [Service]
ExecStart=/usr/lib/systemd/systemd-socket-proxyd /tmp/nginx.sock ExecStart=/usr/lib/systemd/systemd-socket-proxyd /tmp/nginx.sock
PrivateTmp=yes PrivateTmp=yes
PrivateNetwork=yes]]> PrivateNetwork=yes]]></programlisting>
</programlisting>
</example> </example>
<example> <example>
<title>nginx.conf</title> <title>nginx.conf</title>
@ -145,11 +141,9 @@ server {
</example> </example>
<example> <example>
<title>Enabling the proxy</title> <title>Enabling the proxy</title>
<programlisting> <programlisting><![CDATA[# systemctl enable proxy-to-nginx.socket
<![CDATA[# systemctl enable proxy-to-nginx.socket
# systemctl start proxy-to-nginx.socket # systemctl start proxy-to-nginx.socket
$ curl http://localhost:80/]]> $ curl http://localhost:80/]]></programlisting>
</programlisting>
</example> </example>
</refsect2> </refsect2>
<refsect2> <refsect2>
@ -163,18 +157,15 @@ $ curl http://localhost:80/]]>
too.</para> too.</para>
<example> <example>
<title>proxy-to-nginx.socket</title> <title>proxy-to-nginx.socket</title>
<programlisting> <programlisting><![CDATA[[Socket]
<![CDATA[[Socket]
ListenStream=80 ListenStream=80
[Install] [Install]
WantedBy=sockets.target]]> WantedBy=sockets.target]]></programlisting>
</programlisting>
</example> </example>
<example> <example>
<title>proxy-to-nginx.service</title> <title>proxy-to-nginx.service</title>
<programlisting> <programlisting><![CDATA[[Unit]
<![CDATA[[Unit]
Requires=nginx.service Requires=nginx.service
After=nginx.service After=nginx.service
JoinsNamespaceOf=nginx.service JoinsNamespaceOf=nginx.service
@ -182,26 +173,21 @@ JoinsNamespaceOf=nginx.service
[Service] [Service]
ExecStart=/usr/lib/systemd/systemd-socket-proxyd 127.0.0.1:8080 ExecStart=/usr/lib/systemd/systemd-socket-proxyd 127.0.0.1:8080
PrivateTmp=yes PrivateTmp=yes
PrivateNetwork=yes]]> PrivateNetwork=yes]]></programlisting>
</programlisting>
</example> </example>
<example> <example>
<title>nginx.conf</title> <title>nginx.conf</title>
<programlisting> <programlisting><![CDATA[[...]
<![CDATA[[...]
server { server {
listen 8080; listen 8080;
listen unix:/tmp/nginx.sock; listen unix:/tmp/nginx.sock;
[...]]]> [...]]]></programlisting>
</programlisting>
</example> </example>
<example> <example>
<title>Enabling the proxy</title> <title>Enabling the proxy</title>
<programlisting> <programlisting><![CDATA[# systemctl enable proxy-to-nginx.socket
<![CDATA[# systemctl enable proxy-to-nginx.socket
# systemctl start proxy-to-nginx.socket # systemctl start proxy-to-nginx.socket
$ curl http://localhost:80/]]> $ curl http://localhost:80/]]></programlisting>
</programlisting>
</example> </example>
</refsect2> </refsect2>
</refsect1> </refsect1>

View File

@ -442,12 +442,9 @@
be used, they need to be passed be used, they need to be passed
explicitly to a shell implementation explicitly to a shell implementation
of some kind. Example:</para> of some kind. Example:</para>
<programlisting>ExecStart=/bin/sh -c 'dmesg | tac' <programlisting>ExecStart=/bin/sh -c 'dmesg | tac'</programlisting>
</programlisting>
<para>Example:</para> <para>Example:</para>
<programlisting>ExecStart=/bin/echo one ; /bin/echo "two two" <programlisting>ExecStart=/bin/echo one ; /bin/echo "two two"</programlisting>
</programlisting>
<para>This will execute <para>This will execute
<command>/bin/echo</command> two <command>/bin/echo</command> two
times, each time with one argument, times, each time with one argument,
@ -460,8 +457,7 @@
<para>Example:</para> <para>Example:</para>
<programlisting>ExecStart=/bin/echo / &gt;/dev/null &amp; \; \ <programlisting>ExecStart=/bin/echo / &gt;/dev/null &amp; \; \
/bin/ls /bin/ls</programlisting>
</programlisting>
<para>This will execute <para>This will execute
<command>/bin/echo</command> with five <command>/bin/echo</command> with five
arguments: <literal>/</literal>, arguments: <literal>/</literal>,
@ -472,8 +468,7 @@
<para>Example:</para> <para>Example:</para>
<programlisting>Environment="ONE=one" 'TWO=two two' <programlisting>Environment="ONE=one" 'TWO=two two'
ExecStart=/bin/echo $ONE $TWO ${TWO} ExecStart=/bin/echo $ONE $TWO ${TWO}</programlisting>
</programlisting>
<para>This will execute <para>This will execute
<command>/bin/echo</command> with four <command>/bin/echo</command> with four
arguments: <literal>one</literal>, arguments: <literal>one</literal>,

View File

@ -233,8 +233,7 @@
<refsect1> <refsect1>
<title>Examples</title> <title>Examples</title>
<para>Show current settings: <para>Show current settings:
<programlisting> <programlisting>$ timedatectl
$ timedatectl
Local time: Fri, 2012-11-02 09:26:46 CET Local time: Fri, 2012-11-02 09:26:46 CET
Universal time: Fri, 2012-11-02 08:26:46 UTC Universal time: Fri, 2012-11-02 08:26:46 UTC
RTC time: Fri, 2012-11-02 08:26:45 RTC time: Fri, 2012-11-02 08:26:45
@ -250,27 +249,22 @@ NTP synchronized: no
Next DST change: CET → CEST, DST will become active Next DST change: CET → CEST, DST will become active
the clock will jump one hour forward the clock will jump one hour forward
Sun, 2013-03-31 01:59:59 CET Sun, 2013-03-31 01:59:59 CET
Sun, 2013-03-31 03:00:00 CEST Sun, 2013-03-31 03:00:00 CEST</programlisting>
</programlisting>
</para> </para>
<para>Enable an NTP daemon (chronyd): <para>Enable an NTP daemon (chronyd):
<programlisting> <programlisting>$ timedatectl set-ntp true
$ timedatectl set-ntp true
==== AUTHENTICATING FOR org.freedesktop.timedate1.set-ntp === ==== AUTHENTICATING FOR org.freedesktop.timedate1.set-ntp ===
Authentication is required to control whether network time synchronization shall be enabled. Authentication is required to control whether network time synchronization shall be enabled.
Authenticating as: user Authenticating as: user
Password: ******** Password: ********
==== AUTHENTICATION COMPLETE === ==== AUTHENTICATION COMPLETE ===</programlisting>
</programlisting>
<programlisting> <programlisting>$ systemctl status chronyd.service
$ systemctl status chronyd.service
chronyd.service - NTP client/server chronyd.service - NTP client/server
Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled) Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled)
Active: active (running) since Fri, 2012-11-02 09:36:25 CET; 5s ago Active: active (running) since Fri, 2012-11-02 09:36:25 CET; 5s ago
... ...</programlisting>
</programlisting>
</para> </para>
</refsect1> </refsect1>

View File

@ -109,7 +109,6 @@
d /run/user 0755 root root 10d - d /run/user 0755 root root 10d -
L /tmp/foobar - - - - /dev/null</programlisting> L /tmp/foobar - - - - /dev/null</programlisting>
<refsect2> <refsect2>
<title>Type</title> <title>Type</title>
@ -277,13 +276,11 @@ L /tmp/foobar - - - - /dev/null</programlisting>
</para> </para>
<para>For example: <para>For example:
<programlisting> <programlisting># Make sure these are created by default so that nobody else can
# Make sure these are created by default so that nobody else can
d /tmp/.X11-unix 1777 root root 10d d /tmp/.X11-unix 1777 root root 10d
# Unlink the X11 lock files # Unlink the X11 lock files
r! /tmp/.X[0-9]*-lock r! /tmp/.X[0-9]*-lock</programlisting>
</programlisting>
The second line in contrast to the first one The second line in contrast to the first one
would break a running system, and will only be would break a running system, and will only be
executed with <option>--boot</option>.</para> executed with <option>--boot</option>.</para>