chiark / gitweb /
man: reference $TMPDIR, not $TMP in file-hierarchy(7)
[elogind.git] / man / file-hierarchy.xml
index ff2ee3d4bb030e2c7800f1a6ae0a1e97670c3e97..fb72693c0535d22e27b141e949f93c9773582eb8 100644 (file)
@@ -54,7 +54,7 @@
                 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
                 system and service manager are organized based on a
                 file system hierarchy inspired by UNIX, more
-                specificaly the hierarchy described in the <ulink
+                specifically the hierarchy described in the <ulink
                 url="http://refspecs.linuxfoundation.org/FHS_2.3/fhs-2.3.html">File
                 System Hierarchy</ulink> specification and
                 <citerefentry><refentrytitle>hier</refentrytitle><manvolnum>7</manvolnum></citerefentry>. This
                                 root. Usually writable, but this is
                                 not required. Possibly a temporary
                                 file system (<literal>tmpfs</literal>). Not shared with
-                                other hosts (unless read-only). The
-                                administrator may create additional
-                                top-level subdirectories in this tree,
-                                if required and the name does not
-                                conflict with any of the directories
-                                listed below.</para></listitem>
+                                other hosts (unless read-only).
+                                </para></listitem>
                         </varlistentry>
 
                         <varlistentry>
@@ -90,7 +86,7 @@
                                 System Partition, also see
                                 <citerefentry><refentrytitle>systemd-boot-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>. This
                                 directory is usually strictly local
-                                the host, and should be considered
+                                to the host, and should be considered
                                 read-only, except when a new kernel or
                                 boot loader is installed. This
                                 directory only exists on systems that
                                 system users. This directory and
                                 possibly the directories contained
                                 within it might only become available
-                                or writable in late boot or even on
-                                user login only. This directory might
-                                be placed on limited-functionality
+                                or writable in late boot or even only
+                                after user authentication. This directory
+                                might be placed on limited-functionality
                                 network file systems, hence
                                 applications should not assume the
                                 full set of file API is available on
-                                this directory.</para></listitem>
+                                this directory. Applications should
+                                generally not reference this directory
+                                directly, but via the per-user
+                                <varname>$HOME</varname> environment
+                                variable, or via the home directory
+                                field of the user
+                                database.</para></listitem>
                         </varlistentry>
 
                         <varlistentry>
                                 <listitem><para>The place for small
                                 temporary files. This directory is
                                 usually mounted as
-                                <literal>tmpfs</literal> instance, and
+                                <literal>tmpfs</literal> instance, and
                                 should hence not be used for larger
-                                files. Since the directory is
+                                files. (Use
+                                <filename>/var/tmp</filename> for
+                                larger files.) Since the directory is
                                 accessible to other users of the
                                 system it is essential that this
                                 directory is only written to with the
                                 usually flushed at boot-up. Also,
                                 files that are not accessed within a
                                 certain time are usually automatically
-                                deleted.</para></listitem>
+                                deleted. If applications find the
+                                environment variable
+                                <varname>$TMPDIR</varname> set they
+                                should prefer using the directory
+                                specified in it over directly
+                                referencing
+                                <filename>/tmp</filename> (see <citerefentry><refentrytitle>environ</refentrytitle><manvolnum>7</manvolnum></citerefentry> for details).</para></listitem>
                         </varlistentry>
 
                 </variablelist>
                                 for system packages to place runtime
                                 data in. This directory is flushed on
                                 boot, and generally writable for
-                                priviliged programs
+                                privileged programs
                                 only. Always writable.</para></listitem>
                         </varlistentry>
 
                                 <term><filename>/run/user</filename></term>
                                 <listitem><para>Contains per-user
                                 runtime directories, each usually
-                                invidually mounted
+                                individually mounted
                                 <literal>tmpfs</literal>
                                 instances. Always writable, flushed at
                                 each reboot and when the user logs
 
                         <varlistentry>
                                 <term><filename>/usr/lib</filename></term>
-                                <listitem><para>System libraries and
-                                package-specific
-                                data.</para></listitem>
-                        </varlistentry>
-
-                        <varlistentry>
-                                <term><filename>/usr/lib64</filename></term>
-                                <listitem><para>Secondary library
-                                directory for placing 64bit versions
-                                of system libraries in, if the primary
-                                architecture of the system is
-                                32bit. This directory should not be
-                                used for package-specific data, unless
-                                this data requires 64bit-specific
-                                versions, too.</para></listitem>
+                                <listitem><para>Static vendor data
+                                that is compatible with all
+                                architectures (though not necessarily
+                                architecture-independent). Note that
+                                this includes internal
+                                executables or other binaries that are
+                                not regularly invoked from a
+                                shell. Such binaries may be for any
+                                architecture supported by the
+                                system. Do not place public libraries
+                                in this directory, use
+                                <varname>$libdir</varname> (see
+                                below), instead.</para></listitem>
+                        </varlistentry>
+
+                        <varlistentry>
+                                <term><varname>$libdir</varname></term>
+                                <listitem><para>Location for placing
+                                dynamic libraries in. The precise
+                                location depends on the operating
+                                system and the architecture, and is
+                                sometimes
+                                <filename>/usr/lib</filename>,
+                                <filename>/use/lib64</filename> or
+                                <filename>/usr/lib/</filename>
+                                suffixed by an architecture
+                                identifier. This directory should not
+                                be used for package-specific data,
+                                unless this data is
+                                architecture-dependent, too. To query
+                                <varname>$libdir</varname> for the
+                                primary architecture of the system,
+                                invoke
+                                <programlisting># pkg-config --variable=libdir systemd</programlisting></para></listitem>
                         </varlistentry>
 
                         <varlistentry>
                                 <term><filename>/usr/share</filename></term>
                                 <listitem><para>Resources shared
-                                betwen multiple packages, such as
+                                between multiple packages, such as
                                 documentation, man pages, time zone
                                 information, fonts and other
-                                resources.</para></listitem>
+                                resources. Usually, the precise
+                                location and format of files stored
+                                below this directory is subject to
+                                specifications that ensure
+                                interoperability.</para></listitem>
                         </varlistentry>
 
                         <varlistentry>
                                 contrast to <filename>/tmp</filename>
                                 this directory is usually mounted from
                                 a persistent physical file system and
-                                can thus accept larger files. This
-                                directory is generally not flushed at
-                                boot-up, but time-based cleanup of
-                                files that have not been accessed for
-                                a certain time is applied. The same
-                                security restrictions as with
+                                can thus accept larger files. (Use
+                                <filename>/tmp</filename> for smaller
+                                files.) This directory is generally
+                                not flushed at boot-up, but time-based
+                                cleanup of files that have not been
+                                accessed for a certain time is
+                                applied. The same security
+                                restrictions as with
                                 <filename>/tmp</filename> apply, and
                                 hence only
                                 <citerefentry><refentrytitle>mkstemp</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
                                 <citerefentry><refentrytitle>mkdtemp</refentrytitle><manvolnum>3</manvolnum></citerefentry>
                                 or similar calls should be used to
-                                make use of this directory.
+                                make use of this directory. If
+                                applications find the environment
+                                variable <varname>$TMPDIR</varname>
+                                set they should prefer using the
+                                directory specified in it over
+                                directly referencing
+                                <filename>/var/tmp</filename> (see <citerefentry><refentrytitle>environ</refentrytitle><manvolnum>7</manvolnum></citerefentry> for details).
                                 </para></listitem>
                         </varlistentry>
 
                                 <term><filename>/dev</filename></term>
                                 <listitem><para>The root directory for
                                 device nodes. Usually this directory
-                                is mounted as
+                                is mounted as a
                                 <literal>devtmpfs</literal> instance,
                                 but might be of a different type in
                                 sandboxed/containerized setups. This
                                 programs) or
                                 <varname>$XDG_RUNTIME_DIR</varname>
                                 (for user programs) instead of POSIX
-                                shared memory segments, since they
+                                shared memory segments, since those
                                 directories are not world-writable and
                                 hence not vulnerable to
                                 security-sensitive name
                                 <listitem><para>This compatibility
                                 symlink points to
                                 <filename>/usr/lib</filename>,
-                                ensuring that binaries referencing
+                                ensuring that programs referencing
                                 this legacy path correctly find
-                                their libraries.</para></listitem>
+                                their resources.</para></listitem>
                         </varlistentry>
 
                         <varlistentry>
                                 <term><filename>/lib64</filename></term>
 
-                                <listitem><para>This compatibility
-                                symlink points to
-                                <filename>/usr/lib64</filename>,
+                                <listitem><para>On some architecture
+                                ABIs this compatibility symlink points
+                                to <varname>$libdir</varname>,
                                 ensuring that binaries referencing
                                 this legacy path correctly find their
-                                libraries. This symlink only exists on
-                                architectures whose ABI requires a
-                                64bit version of the library
-                                directory.</para></listitem>
+                                dynamic loader. This symlink only
+                                exists on architectures whose ABI
+                                places the dynamic loader in this
+                                path.</para></listitem>
                         </varlistentry>
 
                         <varlistentry>
                     <tbody>
                       <row>
                         <entry><filename>/usr/bin</filename></entry>
-                        <entry>Package executables that shall appear in the <varname>$PATH</varname> executable search path. It is not recommended to place internal binaries or binaries that are not commonly invoked from the shell in this directory, such as daemon binaries. As this directory is shared with most other packages of the system special care should be take to pick unique names for files placed here, that are unlikely to clash with other package's files.</entry>
+                        <entry>Package executables that shall appear in the <varname>$PATH</varname> executable search path, compiled for the primary architecture of the operating system. It is not recommended to place internal binaries or binaries that are not commonly invoked from the shell in this directory, such as daemon binaries. As this directory is shared with most other packages of the system special care should be taken to pick unique names for files placed here, that are unlikely to clash with other package's files.</entry>
                       </row>
                       <row>
-                        <entry><filename>/usr/lib</filename></entry>
-                        <entry>Public shared libraries of the package, compiled for the primary architecture of the operating system. As above, be careful with using too generic names, and pick unique names for your libraries to place here to avoid name clashes.</entry>
+                        <entry><filename>$libdir</filename></entry>
+                        <entry>Public shared libraries of the package. As above, be careful with using too generic names, and pick unique names for your libraries to place here to avoid name clashes.</entry>
                       </row>
                       <row>
                         <entry><filename>/usr/lib/<replaceable>package</replaceable></filename></entry>
-                        <entry>Private other vendor resources of the package, including private binaries and libraries, but also including any other kind of read-only vendor data.</entry>
-                      </row>
-                      <row>
-                        <entry><filename>/usr/lib64</filename></entry>
-                        <entry>Public shared libraries of the package, compiled for the secondary, 64bit architecture, if this is part of the Operating System ABI.</entry>
+                        <entry>Private static vendor resources of the package, including private binaries and libraries, or any other kind of read-only vendor data.</entry>
                       </row>
                       <row>
-                        <entry><filename>/usr/lib64/<replaceable>package</replaceable></filename></entry>
-                        <entry>Private other vendor resources of the package that are architecture-specific and cannot be shared between primary and secondary architectures. Note that this generally does not include private binaries since binaries of the primary architecture may generally be invoked from secondary architecture code just fine.</entry>
+                        <entry><filename>$libdir/<replaceable>package</replaceable></filename></entry>
+                        <entry>Private other vendor resources of the package that are architecture-specific and cannot be shared between architectures. Note that this generally does not include private exectuables since binaries of a specific architecture may be freely invoked from any other supported system architecture.</entry>
                       </row>
                       <row>
                         <entry><filename>/usr/include/<replaceable>package</replaceable></filename></entry>
                       </row>
                       <row>
                         <entry><filename>/etc/<replaceable>package</replaceable></filename></entry>
-                        <entry>System-specific configuration for the package. It is recommended to default to safe fallbacks if this configuration is missing, if this is possible. Alternatively, a <citerefentry><refentrytitle>tmpfiles.d</refentrytitle><manvolnum>5</manvolnum></citerefentry> fragment may be used to copy or symlink the necessary files and directores from <filename>/usr/share/factory</filename> during boot, via the <literal>L</literal> or <literal>C</literal> directives.</entry>
+                        <entry>System-specific configuration for the package. It is recommended to default to safe fallbacks if this configuration is missing, if this is possible. Alternatively, a <citerefentry><refentrytitle>tmpfiles.d</refentrytitle><manvolnum>5</manvolnum></citerefentry> fragment may be used to copy or symlink the necessary files and directories from <filename>/usr/share/factory</filename> during boot, via the <literal>L</literal> or <literal>C</literal> directives.</entry>
                       </row>
                       <row>
                         <entry><filename>/run/<replaceable>package</replaceable></filename></entry>
                         <citerefentry><refentrytitle>hier</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
                         <citerefentry><refentrytitle>systemd-boot-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
                         <citerefentry><refentrytitle>sysctl.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
+                        <citerefentry><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>
                 </para>
         </refsect1>