]>
Commit | Line | Data |
---|---|---|
79d615d5 RS |
1 | <?xml version="1.0"?> |
2 | <!--*-nxml-*--> | |
3 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> | |
4 | <!-- | |
5 | This file is part of systemd. | |
6 | ||
7 | Copyright 2016 Red Hat, Inc. | |
8 | Copyright 2017 Zbigniew Jędrzejewski-Szmek | |
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 | <refentry id="environment.d" xmlns:xi="http://www.w3.org/2001/XInclude"> | |
24 | ||
25 | <refentryinfo> | |
26 | <title>environment.d</title> | |
27 | <productname>systemd</productname> | |
28 | ||
29 | <authorgroup> | |
30 | <author> | |
31 | <contrib>Developer</contrib> | |
32 | <firstname>Ray</firstname> | |
33 | <surname>Strode</surname> | |
34 | <email>rstrode@redhat.com</email> | |
35 | </author> | |
36 | </authorgroup> | |
37 | </refentryinfo> | |
38 | ||
39 | <refmeta> | |
40 | <refentrytitle>environment.d</refentrytitle> | |
41 | <manvolnum>5</manvolnum> | |
42 | </refmeta> | |
43 | ||
44 | <refnamediv> | |
45 | <refname>environment.d</refname> | |
46 | <refpurpose>Definition of user session environment</refpurpose> | |
47 | </refnamediv> | |
48 | ||
49 | <refsynopsisdiv> | |
50 | <para><filename>~/.config/environment.d/*.conf</filename></para> | |
51 | <para><filename>/etc/environment.d/*.conf</filename></para> | |
52 | <para><filename>/run/environment.d/*.conf</filename></para> | |
53 | <para><filename>/usr/lib/environment.d/*.conf</filename></para> | |
54 | <para><filename>/etc/environment</filename></para> | |
55 | </refsynopsisdiv> | |
56 | ||
57 | <refsect1> | |
58 | <title>Description</title> | |
59 | ||
60 | <para>The <filename>environment.d</filename> directories contain a list of "global" environment | |
61 | variable assignments for the user environment. | |
62 | <citerefentry><refentrytitle>systemd-environment-d-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry> | |
63 | parses them and updates the environment exported by the systemd user instance to the services it | |
64 | starts.</para> | |
65 | ||
66 | <para>It is recommended to use numerical prefixes for file names to simplify ordering.</para> | |
67 | ||
68 | <para>For backwards compatibility, a symlink to <filename>/etc/environment</filename> is | |
69 | installed, so this file is also parsed.</para> | |
70 | </refsect1> | |
71 | ||
72 | <xi:include href="standard-conf.xml" xpointer="confd" /> | |
73 | ||
74 | <refsect1> | |
75 | <title>Configuration Format</title> | |
76 | ||
77 | <para>The configuration files contain a list of | |
78 | <literal><replaceable>KEY</replaceable>=<replaceable>VALUE</replaceable></literal> environment | |
79 | variable assignments, separated by newlines. The right hand side of these assignments may | |
80 | reference previously defined environment variables, using the <literal>${OTHER_KEY}</literal> | |
ccad1fd0 | 81 | and <literal>$OTHER_KEY</literal> format. No other elements of shell syntax are supported. |
79d615d5 RS |
82 | </para> |
83 | ||
84 | <refsect2> | |
85 | <title>Example</title> | |
86 | <example> | |
87 | <title>Setup environment to allow access to a program installed in | |
88 | <filename noindex='true'>/opt/foo</filename></title> | |
89 | ||
90 | <para><filename>/etc/environment.d/60-foo.conf</filename>: | |
91 | </para> | |
92 | <programlisting> | |
93 | FOO_DEBUG=force-software-gl,log-verbose | |
ccad1fd0 | 94 | PATH=/opt/foo/bin:$PATH |
79d615d5 RS |
95 | LD_LIBRARY_PATH=/opt/foo/lib |
96 | XDG_DATA_DIRS=/opt/foo/share:${XDG_DATA_DIRS} | |
97 | </programlisting> | |
98 | </example> | |
99 | </refsect2> | |
100 | </refsect1> | |
101 | ||
102 | <refsect1> | |
103 | <title>See Also</title> | |
104 | <para> | |
105 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
106 | <citerefentry><refentrytitle>systemd-environment-d-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>, | |
107 | <citerefentry><refentrytitle>systemd.environment-generator</refentrytitle><manvolnum>7</manvolnum></citerefentry> | |
108 | </para> | |
109 | </refsect1> | |
110 | ||
111 | </refentry> |