/[gentoo-dk]/gentoo-dk/pre1/env.d-howto.xml
ViewVC logotype

Diff of /gentoo-dk/pre1/env.d-howto.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by mejlholm, Tue Nov 18 23:39:12 2003 UTC revision 1.3 by mejlholm, Sat Nov 22 09:53:44 2003 UTC
# Line 1  Line 1 
1  <?xml version='1.0' encoding="UTF-8"?>  <?xml version='1.0' encoding="iso-8859-1"?>
2  <!-- $Header$ -->  <!-- $Header$ -->
3  <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">  <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
4    
5  <guide link = "/doc/en/env.d-howto.xml">  <guide link = "/doc/da/env.d-howto.xml">
6  <title>Env.d HOWTO</title>  <title>Env.d HOWTO</title>
7  <author title="Author"><!-- zhen@gentoo.org -->John P. Davis</author>  <author title="Forfatter"><!-- zhen@gentoo.org -->John P. Davis</author>
8    <author title="Oversætter"><mail link="aaby@gentoo.org">Arne Mejlholm</mail></author>
9    
10    
11  <abstract>  <abstract>
12          This guide will explain the meaning and use of the  Denne guide forklarer formålet og brugen af <path>/etc/env.d</path>
13          <path>/etc/env.d</path> directory and its contents.  biblioteket og dets indhold.
14  </abstract>  </abstract>
15    
16  <license/>  <license/>
# Line 17  Line 19 
19  <date>October 23, 2003</date>  <date>October 23, 2003</date>
20    
21  <chapter>  <chapter>
22          <title>Introduction to <c>env.d</c> and Generic Variables</title>          
23          <section>  <title>Introduktion til <c>env.d</c> og generiske variable</title>      
24                  <title>Basic Gentoo Environment Variables</title>  <section>
25                  <body>                  
26                  <p>  <title>Basale Gentoo miljø variable</title>
27                          One of the common questions that we see from Gentoo users  <body>
28                          is "where are my environment variables, and what are they set to?".    <p>
29                          To understand this question, first we have to know what an environment  Et af de mest almindelige spørgsmål vi hører fra Gentoo brugere er
30                          variable is.  An environment variable is set whenever the <c>export</c>  "hvor er mine miljø variable og hvad er de sat til?". For at forstå
31                          command is issued.  For example, if you were to issue an <c>export  dette spørgsmål er vi først nødt til at vide hvad en miljø variabel
32                          EDITOR="/usr/sbin/vim"</c>, you are setting an environment variable  er. En miljø variabel bliver sat når <c>export</c> kommandoen bliver
33                          that tells the system what your default editor is vim.  There are many  kørt. F.eks, hvis du kørte en <c>export EDITOR="/usr/sbin/vim"</c>, så
34                          different kinds of environment variables that can be set on your Gentoo  satte du en miljø variabel der fortæller systemet at din standard
35                          system, here are some examples:  editor er vim. Der er mange forskellige slags miljø variable der kan
36                  </p>  sættes på dit Gentoo system, her er nogle eksempler:
37    </p>
38                  <note>  
39                          <c>export</c> will set the Environment Variable in the shell *and* all  <note>
40                          child processes.  If you just want to set the variable without affecting  <c>export</c> vil sætte miljø variablen i shell'en *og* i alle de efterfølgende
41                          child processes, just do something like <i>FOO="bar"</i>.  processer. Hvis du vil sætte variablen uden at påvirke de
42                  </note>  efterfølgende processer, så skal du gøre noget lignende <i>FOO="bar"</i>.
43    </note>
44                  <note>  
45                          Your <i>00basic</i> file may differ.  This is not a problem, as these variables  <note>
46                          are the default ones that are packaged with Gentoo.  Din <i>00basic</i> fil kan skille sig ud fra det følgende. Dette er
47                  </note>  ikke noget problem, da disse variable er standarderne der kommer med Gentoo.
48    </note>
49                  <info>  
50                          These examples can be found in <path>/etc/env.d/00basic</path>.  <info>
51                  </info>  Disse eksempler kan findes i <path>/etc/env.d/00basic</path>.
52    </info>
53                  <table>  
54                  <tr>  <table>
55                          <th>Variable</th>  <tr>
56                          <th>Function</th>  <th>Variabel</th>
57                  </tr>  <th>Funktion</th>
58                  <tr>  </tr>
59                          <ti>PATH</ti>  <tr>
60                          <ti>  <ti>PATH</ti>
61                          This sets the default path of where programs are found.  It is ':' delimited.    <ti>
62                          A path variable would look something like <c>PATH=/usr/local/bin:/opt/bin</c>.  Dette sætter standard stien til hvor programmer kan findes. Den bliver
63                          </ti>  afgrænset af ':'. En sti variabel vil ligne det følgende <c>PATH=/usr/local/bin:/opt/bin</c>.
64                  </tr>  </ti>
65                  <tr>  </tr>
66                          <ti>ROOTPATH</ti>  <tr>
67                          <ti>  <ti>ROOTPATH</ti>
68                          This variable is like the one above, but it sets the default root for programs  <ti>
69                          for <c>root</c>.  An example of this would be something like  Denne variabel er ligesom den ovenfor, men den sætter standard roden
70                          <c>ROOTPATH=/usr/local/bin:/opt/bin</c>.  for programmer for brugeren <c>root</c>.  Et eksempel på dette vil
71                  </ti>  være noget i stil med <c>ROOTPATH=/usr/local/bin:/opt/bin</c>.
72                  </tr>  </ti>
73                  <tr>  </tr>
74                          <ti>LDPATH</ti>  <tr>
75                          <ti>  <ti>LDPATH</ti>
76                          This variable specifies what the library path is for linking.  This is also ':'  <ti>
77                          delimited.  An example of this would be <c>LDPATH=/usr/local/lib</c>.  Denne variabel specificerer hvad bibliotek stien er til at
78                          </ti>  linke. Denne er også afgrænset af ':'. Et eksempel på denne kunne være <c>LDPATH=/usr/local/lib</c>.
79                  </tr>  </ti>
80                  <tr>  </tr>
81                          <ti>MANPATH</ti>  <tr>
82                          <ti>  <ti>MANPATH</ti>
83                          This specifies where the manpages are stored on your machine.  Its like  <ti>
84                          <i>PATH</i>, but its for the manpages.  An example of this would be  Dette specificerer hvor man siderne gemmes på din maskine. Det er
85                          <c>MANPATH=/usr/share/man:/usr/local/share/man</c>.  ligesom <i>PATH</i>, men den bruges til man sider. Et eksempel kunne være
86                          </ti>  <c>MANPATH=/usr/share/man:/usr/local/share/man</c>.
87                  </tr>  </ti>
88                  <tr>  </tr>
89                          <ti>INFODIR</ti>  <tr>
90                          <ti>  <ti>INFODIR</ti>
91                          This specifies where all of your info files are kept.  An example of this would  <ti>
92                          be <c>INFODIR=/usr/share/info</c>.  Dette specificerer hvor alle dine info filer bliver opbevaret. Et
93                          </ti>  eksempel på dette kunne være <c>INFODIR=/usr/share/info</c>.
94                  </tr>  </ti>
95                  <tr>  </tr>
96                          <ti>PAGER</ti>  <tr>
97                          <ti>  <ti>PAGER</ti>
98                          This specifies what pager is used, i.e. less or more.  An example of this would  <ti>
99                          be <c>PAGER=/usr/bin/less</c>.  Dette specificerer hvilken pager der skal bruges, f.eks. less eller
100                          </ti>  more. Et eksempel på dette ville være <c>PAGER=/usr/bin/less</c>.
101                  </tr>  </ti>
102                  <tr>  </tr>
103                          <ti>EDITOR</ti>  <tr>
104                          <ti>  <ti>EDITOR</ti>
105                          This specifies the default editor for the system.  This would look something like  <ti>
106                          this: <c>EDITOR=/usr/bin/vim</c>.  Dette specificerer standard editoren for systemet. Det kunne se sådan ud: <c>EDITOR=/usr/bin/vim</c>.
107                          </ti>  </ti>
108                  </tr>  </tr>
109                  </table>  </table>
110    
111                  <p>  <p>
112                          This is an example of a <i>00basic</i> file.  This just gives you an idea of what  Dette er et eksempel på en <i>00basic</i> fil. Dette giver dig bare en
113                          it looks like.  If your <c>00basic</c> gets wrecked, you can use this one!  ide om hvordan de ser ud. Hvis din <c>00basic</c> bliver smadret kan
114                  </p>  du bruge denne!
115    </p>
116    
117                  <pre caption = "00basic">  <pre caption = "00basic">
118  # /etc/env.d/00basic:  # /etc/env.d/00basic:
119  #  /home/cvsroot/gentoo-src/rc-scripts/etc/env.d/00basic,v 1.11 2003/02/17 02:48:39 azarah Exp &#36;  #  /home/cvsroot/gentoo-src/rc-scripts/etc/env.d/00basic,v 1.11 2003/02/17 02:48:39 azarah Exp &#36;
120    
# Line 124  INFOPATH="/usr/share/info" Line 127  INFOPATH="/usr/share/info"
127  CVS_RSH="ssh"  CVS_RSH="ssh"
128  PAGER="/usr/bin/less"  PAGER="/usr/bin/less"
129  LESSOPEN="|lesspipe.sh %s"  LESSOPEN="|lesspipe.sh %s"
130                  </pre>  </pre>
131                  </body>  </body>
132          </section>  </section>
133    
134          <section>  <section>
135                  <title>env.d Formatting</title>  <title>env.d Formattering</title>
136                  <body>  <body>
137                          <p>  <p>
138                          The files inside of <c>env.d</c> are arranged in a logical order so that when  Filerne indeni <c>env.d</c> er arrangeret i en logisk rækkefølge sådan
139                          <c>env-update</c> is run, it properly orders the variables.  The numbers in  at når <c>env-update</c> køres, så ordner den variablerne
140                          front of the files specify which order they are parsed, so <i>00basic</i> will  korrekt. Tallene foran filerne specificerer i hvilken rækkefølge de
141                          go first, then <i>01something</i> will be parsed and so on.  The content inside  bliver behandlet, så <i>00basic</i> kommer først, derefter bliver
142                          of the files also have a specific format:  <i>01etellerandet</i> behandlet og så videre. Indholdet i en af disse
143                          </p>  filer har et specifikt format:
144    </p>
145                          <pre caption = "Content Format">  
146  <comment># This is a comment, just like BASH</comment>  <pre caption = "Formatet af indhold">
147  <i>VARIABLE1=/path/to/something</i>  <comment># Dette er en kommentar, ligesom med BASH</comment>
148  <comment># Some of the variables can have : delimited arguments.</comment>  <i>VARIABEL1=/sti/til/etellerandet</i>
149  <i>VAR1A=/path/to/something:/path/to/another/something</i>  <comment># Nogle af variablerne kan have : afgrænsende argumenter.</comment>
150  <i>VARIABLE2=name_something</i>  <i>VAR1A=/sti/til/etellerandet:/sti/til/enanden/etellerandet</i>
151                          </pre>  <i>VARIABEL2=etellerandet_navn</i>
152                  </body>  </pre>
153          </section>  </body>
154    </section>
155  </chapter>  </chapter>
156    
157  <chapter>  <chapter>
158          <title>Special Variables, and How it all Comes Together</title>  <title>Specielle variable og hvordan det hele hænger sammen</title>
159          <section>  <section>
160                  <title>Special Variables</title>  <title>Specielle variable</title>
161                          <body>  <body>
162                          <p>  <p>
163                                  There are some special variables that are included in <c>env.d</c>.    Der er nogle specielle variable der er inkluderet i <c>env.d</c>.  
164                                  These include:  <i>KDEDIRS, PATH, CLASSPATH, LDPATH, MANPATH, INFODIR,  Deriblandt er:  <i>KDEDIRS, PATH, CLASSPATH, LDPATH, MANPATH, INFODIR,
165                                  ROOTPATH, CONFIG_PROTECT, CONFIG_PROTECT_MASK</i>.  These are special  ROOTPATH, CONFIG_PROTECT, CONFIG_PROTECT_MASK</i>. Disse er specielle
166                                  because they are processed in a special fashion and they are put into  fordi de er forudbehandlede på en speciel måde og de bliver puttet ind
167                                  special files, which I will explain later.  i specielle filer, hvilket jeg vil forklare senere.
168                          </p>  </p>
169    
170                          <note>  <note>
171                                  Some of the variables mentioned below are also mentioned above in  Nogle af de variable der bliver nævnt nedenfor bliver også nævnt i
172                                  <i>00basic</i>.  This is fine because these vars can be used more than  <i>00basic</i>. Dette er fint nok fordi disse variable kan bruges mere
173                                  once in seperate files (more explained below).  end en gang i seperate filer (forklares yderligere nedenfor).
174                          </note>  </note>
175    
176                          <table>  <table>
177                          <tr>  <tr>
178                                  <th>Variable</th>  <th>Variabel</th>
179                                  <th>Function</th>  <th>Funktion</th>
180                          </tr>  </tr>
181                          <tr>  <tr>
182                                  <ti>KDEDIRS</ti>  <ti>KDEDIRS</ti>
183                                  <ti>  <ti>
184                                  This is the path for all of KDE's files.  Dette er stien til alle KDE's filer.
185                                  </ti>  </ti>
186                          </tr>  </tr>
187                          <tr>  <tr>
188                                  <ti>PATH</ti>  <ti>PATH</ti>
189                                  <ti>  <ti>
190                                  Previously mentioned, ':' delimited, (see above).  Nævnt før. ':' afgrænset (se ovenfor).
191                                  </ti>  </ti>
192                          </tr>  </tr>
193                          <tr>  <tr>
194                                  <ti>CLASSPATH</ti>  <ti>CLASSPATH</ti>
195                                  <ti>  <ti>
196                                  Sets the path to Java classes, ':' delimited.  Sætter stien for Java klasser, ':' afgrænset
197                                  </ti>  </ti>
198                          </tr>  </tr>
199                          <tr>  <tr>
200                                  <ti>LDPATH</ti>  <ti>LDPATH</ti>
201                                  <ti>  <ti>
202                                  Previously mentioned (see above).  Nævnt før. (se ovenfor). ':' afgrænset.
203                                  </ti>  </ti>
204                          </tr>  </tr>
205                          <tr>  <tr>
206                                  <ti>MANPATH</ti>  <ti>MANPATH</ti>
207                                  <ti>  <ti>
208                                  Previously mentioned (see above), ':' delimited.  Nævnt før. (se ovenfor). ':' afgrænset.
209                                  </ti>  </ti>
210                          </tr>  </tr>
211                          <tr>  <tr>
212                                  <ti>INFODIR</ti>  <ti>INFODIR</ti>
213                                  <ti>  <ti>
214                                  Previously mentioned (see above), ':' delimited.  Nævnt før. (se ovenfor). ':' afgrænset.
215                                  </ti>  </ti>
216                          </tr>  </tr>
217                          <tr>  <tr>
218                                  <ti>ROOTPATH</ti>  <ti>ROOTPATH</ti>
219                                  <ti>  <ti>
220                                  Previously mentioned (see above), ':' delimited.  Nævnt før. (se ovenfor). ':' afgrænset.
221                                  </ti>  </ti>
222                          </tr>  </tr>
223                          <tr>  <tr>
224                                  <ti>CONFIG_PROTECT</ti>  <ti>CONFIG_PROTECT</ti>
225                                  <ti>  <ti>
226                                  This specifies which config files in <path>/etc</path>that you want  Dette specificerer hvilke konfigurationsfiler i <path>/etc</path> som
227                                  protected from new ebuilds, the arguments given to this are space  du vil beskytte mod nye ebuilds, argumenterne der gives til dette er
228                                  delimited.  afgrænset af mellemrum.
229                                  </ti>  </ti>
230                          </tr>  </tr>
231                          <tr>  <tr>
232                                  <ti>CONFIG_PROTECT_MASK</ti>  <ti>CONFIG_PROTECT_MASK</ti>
233                                  <ti>  <ti>
234                                  This is basically the inverse of CONFIG_PROTECT, it unprotects certain  Dette er ganske simpelt den inverse af CONFIG_PROTECT, den ubeskytter
235                                  files in <path>/etc</path> that you want to be changed automatically by  bestemte filer i <path>/etc</path> som du ønsker skal ændres
236                                  the emerge process.  automatisk af emerge processen.
237                                  </ti>  </ti>
238                          </tr>  </tr>
239                          </table>  </table>
240                  </body>  </body>
241          </section>  </section>
242    
243          <section>  <section>
244                  <title>Putting Everything Together</title>  <title>At samle det hele</title>
245                  <body>  <body>
246                          <p>  <p>
247                          Alright, so now that I have defined everything, you are probably wondering what  Okay, så nu hvor jeg har defineret alting spekulerer du garanteret på
248                          in the world this has to do with you and your Gentoo machine.  The power of  hvad dette dog har at gøre med dig og din Gentoo maskine. Styrken i <i>env.d</i>
249                          <i>env.d</i> is the power that you can change these variables to whatever you  er den at du kan ændre disse variable til hvad du end har brug for at
250                          need them to be.  With the definitions above, hopefully you will be able to do this.  de skal være. Med definitionerne ovenfor skulle du forhåbentligt være
251                          </p>  i stand til at gøre dette.
252    </p>
253                          <p>  
254                          Since we have a handle on what is going on, it is time to explain what happens  <p>
255                          to these variables.  When <c>env-update</c> is called, it links all of these  Da vi har styr på hvad der sker er det tid til at forklare hvad der
256                          files in order.  Remember when I said that it is alright to have multiple  sker med disse variable. Når <c>env-update</c> bliver kaldt linker det
257                          <i>PATH</i> variables as long as they are in different files?  This is because  alle disse filer i rækkefølge. Husker du da jeg sagde at det er i
258                          <c>env-update</c> will go through the files sequentially and add the paths  orden at have adskillige <i>PATH</i> variabler, så længe at de er i
259                          together.  So, if you have a <i>PATH</i> for KDE, GNOME, your default  forskellige filer? Dette er fordi <c>env-update</c> går gennem filerne
260                          <i>PATH</i>, and one for X, <c>env-update</c> will concatenate all of those paths  sekventielt og føjer stierne sammen. Så hvis du har en <i>PATH</i> til
261                          together so that your default <i>PATH</i> becomes all of those paths combined.    KDE, GNOME, din standard <i>PATH</i> og en til X, så vil
262                          Spiffy eh?  <c>env-update</c> sammenslutte alle disse stier så din standard
263                          </p>   <i>PATH</i> bliver alle disse stier kombineret. Smart ikke?
264    </p>
265                          <p>  
266                          Since these variables are now linked together, it is important to note where they  <p>
267                          are stored.  Da disse variabler nu er linket sammen er det vigtigt at notere hvor
268                          </p>  de bliver gemt.
269    </p>
270                          <note>  
271                          The below files are created by running <c>env-update</c>.  <note>
272                          </note>  Filerne nedenfor bliver lavet ved at køre <c>env-update</c>.
273    </note>
274    
275                          <pre caption = "Files Created from the Summation of all files in env.d">  <pre caption = "Filer lavet ved opsummeringen af alle filer i env.d">
276  <i>LDPATH ----> /etc/ld.so.conf</i>  <i>LDPATH ----> /etc/ld.so.conf</i>
277  <i>CONFIG_PROTECT and CONFIG_PROTECT_MASK ----> /etc/profile.env (as exported variable)</i>  <i>CONFIG_PROTECT and CONFIG_PROTECT_MASK ----> /etc/profile.env (som eksporterede variable)</i>
278  <i>Specials and Others ----> /etc/profile.env</i>  <i>De specielle og andre ----> /etc/profile.env</i>
279                          </pre>  </pre>
280    
281                          <p>  <p>
282                          If you look at <path>/etc/ld.so.conf</path>, you can see clearly that  Hvis du kigger i <path>/etc/ld.so.conf</path> kan du klart se at
283                          <i>env.d</i> was the source of the information contained within.  <i>env.d</i> var kilden til al den information der er indeholdt deri.
284                          </p>  </p>
285    
286                          <pre caption = "/etc/ld.so.conf">  <pre caption = "/etc/ld.so.conf">
287  # ld.so.conf autogenerated by env-update; make all changes to  # ld.so.conf autogenerated by env-update; make all changes to
288  # contents of /etc/env.d directory  # contents of /etc/env.d directory
289  /usr/local/lib  /usr/local/lib
# Line 291  LESSOPEN="|lesspipe.sh %s" Line 296  LESSOPEN="|lesspipe.sh %s"
296  /usr/qt/3/lib  /usr/qt/3/lib
297  /usr/qt/2/lib  /usr/qt/2/lib
298  /usr/kde/3/lib  /usr/kde/3/lib
299                          </pre>  </pre>
300    
301                          <p>  <p>
302                          It is a good thing to know that <path>/etc/profile.env</path> is sourced by your  Det er en god ting at vide at <path>/etc/profile.env</path> skabes af
303                          shell session.  This is a good thing; now you can use all of your newly defined  din shell session. Dette er en god ting; nu kan du bruge alle dine
304                          variables next time that you login.  nydefinerede variable næste gang du logger ind.
305                          </p>  </p>
306    
307                          <pre capton = "Sequence of events from env-update">  <pre capton = "Sekvensen af hændelser fra env-update">
308  <i>/etc/env.d settings ---&gt; env-update ---&gt; /etc/profile.env ---&gt; /etc/profile  <i>/etc/env.d settings ---&gt; env-update ---&gt; /etc/profile.env ---&gt; /etc/profile
309  ---&gt; bash ---&gt; all your programs</i>  ---&gt; bash ---&gt; alle dine programmer</i>
310                          </pre>  </pre>
   
                         <p>  
                         Now that you have a <i>profile.env</i> it should look something like this:  
                         </p>  
311    
312                          <pre caption = "/etc/profile.env">  <p>
313  <comment>(To improve readability, we have wrapped two lines in this example)</comment>  Nu hvor du har en <i>profile.env</i> så skulle den gerne ligne dette:
314    </p>
315    
316    <pre caption = "/etc/profile.env">
317    <comment>(For at øge læsbarheden har vi klappet to linier sammen i
318    dette eksempel)</comment>
319  export CONFIG_PROTECT='/usr/kde/3/share/config /usr/share/config'  export CONFIG_PROTECT='/usr/kde/3/share/config /usr/share/config'
320  export KDEDIRS='/usr/kde/3:/usr'  export KDEDIRS='/usr/kde/3:/usr'
321  export MANPATH='/usr/share/man:/usr/local/share/man:/usr/X11R6/man:/opt/blackdown-jdk-1.3.1/man'  export MANPATH='/usr/share/man:/usr/local/share/man:/usr/X11R6/man:/opt/blackdown-jdk-1.3.1/man'
# Line 334  export QTDIR='/usr/qt/3' Line 340  export QTDIR='/usr/qt/3'
340  export JAVA_HOME='/opt/blackdown-jdk-1.3.1'  export JAVA_HOME='/opt/blackdown-jdk-1.3.1'
341  export XINITRC='/etc/X11/xinit/xinitrc'  export XINITRC='/etc/X11/xinit/xinitrc'
342  export MOZILLA_FIVE_HOME='/usr/lib/mozilla'  export MOZILLA_FIVE_HOME='/usr/lib/mozilla'
343                          </pre>  </pre>
344    
345                          <p>  <p>
346                          Alright, thats all I have to say, so go have some fun, and don't break too much!  Okay, det er alt hvad jeg har at sige, så smut hen og hav det sjovt,
347                          </p>  og lad være med at ødelægge for meget!
348                          </body>  </p>
349                  </section>  </body>
350          </chapter>  </section>
351    </chapter>
352  </guide>  </guide>

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26