· KLDP.org · KLDP.net · KLDP Wiki · KLDP BBS ·
GentooX86 Handbook_Ko_2-5


1. ȯ°æ º¯¼ö

1.1. ȯ°æ º¯¼ö?

1.1.1. ±×°ÍµéÀº µ¥Ã¼ ¹º°¡¿ä?

ȯ°æº¯¼ö´Â Çϳª ÀÌ»óÀÇ ¾îÇø®ÄÉÀ̼ǿ¡¼­ »ç¿ëµÇ´Â Á¤º¸¸¦ Æ÷ÇÔÇÏ°í ÀÖ´Â À̸§ÀÌ ºÙÀº °´Ã¼ÀÔ´Ï´Ù. ¤Ô¸¹Àº »ç¿ëÀÚµé (±×¸®°í ƯÈ÷ ¸®´ª½º¸¦ °« Á¢ÇÑ) Àº ÀÌ°ÍÀÌ ¾à°£ ÀÌ»óÇϰųª °ü¸®°¡ ¾ÈµÇ´Â °É ¹ß°ßÇÒ °ÍÀÔ´Ï´Ù. ±×·¯³ª ±×·¸°Ô »ý°¢ÇÏ´Â°Ç ½Ç¼öÀÔ´Ï´Ù. ȯ°æº¯¼ö¸¦ »ç¿ëÇÔÀ¸·Î ÀÎÇØ Çϳª ÀÌ»óÀÇ ¾îÇø®ÄÉÀ̼ǿ¡¼­ ȯ°æ¼³Á¤À» ½±°Ô º¯°æÇÒ ¼ö ÀÖ½À´Ï´Ù.

1.1.2. Áß¿äÇÑ ¿¹

´ÙÀ½ÀÇ Ç¥¿¡¼­´Â ¸®´ª½º ½Ã½ºÅÛ¿¡¼­ »ç¿ëµÇ´Â ¸¹Àº º¯¼öµéÀ» ³ª¿­ÇÏ°í ±×µéÀÇ »ç¿ë¿¡ ´ëÇØ ¼³¸íÇÕ´Ï´Ù. ¿¹Á¦ °ªµéÀº Ç¥ ´ÙÀ½¿¡ ³ª¿É´Ï´Ù.

Variable Description
PATH This variable contains a colon-separated list of directories in which your system looks for executable files. If you enter a name of an executable (such as ls, rc-update or emerge) but this executable is not located in a listed directory, your system will not execute it (unless you enter the full path as command, such as /bin/ls).
ROOTPATH This variable has the same function as PATH, but this one only lists the directories that should be checked when the root-user enters a command.
LDPATH This variable contains a colon-separated list of directories in which the dynamical linker searches through to find a library.
MANPATH This variable contains a colon-separated list of directories in which the man command searches for the man pages.
INFODIR This variable contains a colon-separated list of directories in which the info command searches for the info pages.
PAGER This variable contains the path to the program used to list the contents of files through (such as less or more).
EDITOR This variable contains the path to the program used to change the contents of files with (such as nano or vi).
KDEDIRS This variable contains a colon-separated list of directories which contain KDE-specific material.
CONFIG_PROTECT This variable contains a space-delimited list of directories which should be protected by Portage during updates.
CONFIG_PROTECT_MASK This variable contains a space-delimited list of directories which should not be protected by Portage during updates.

¾Æ·¡¿¡¼­ ÀÌµé º¯¼ö¿¡ ´ëÇÑ ¼±¾ðÀÇ ¿¹¸¦ º¸½Ç ¼ö ÀÖ½À´Ï´Ù.

¿¹Á¦ 1-1 : ¼±¾ð ¿¹Á¦
PATH="/bin:/usr/bin:/usr/local/bin:/opt/bin:/usr/games/bin"
ROOTPATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin"
LDPATH="/lib:/usr/lib:/usr/local/lib:/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3"
MANPATH="/usr/share/man:/usr/local/share/man"
INFODIR="/usr/share/info:/usr/local/share/info"
PAGER="/usr/bin/less"
EDITOR="/usr/bin/vim"
KDEDIRS="/usr"
CONFIG_PROTECT="/usr/X11R6/lib/X11/xkb /opt/tomcat/conf \
                /usr/kde/3.1/share/config /usr/share/texmf/tex/generic/config/ \
                /usr/share/texmf/tex/platex/config/ /usr/share/config"
CONFIG_PROTECT_MASK="/etc/gconf"

1.2. Àü¿ªÀû º¯¼ö Á¤ÀÇ

1.2.1. /etc/env.d µð·ºÅ丮

ÀÌ º¯¼öµéÀÇ Á¤ÀǸ¦ Çѵ¥ ¸ðÀ¸±â À§ÇØ Á¨Åõ´Â /etc/env.d µð·ºÅ丮¸¦ ¼Ò°³ÇÕ´Ï´Ù. ÀÌ µð·ºÅ丮 ¾È¿¡´Â 00basic, 05gccµî°ú °°Àº ¼ö¸¹Àº ÆÄÀϵéÀ» ãÀ» ¼ö ÀÖÀ» °ÍÀÔ´Ï´Ù. ÀÌ°ÍÀº ±×µéÀÇ À̸§¿¡¼­ ¾Ë·ÁÁÖ´Â ¾îÇø®ÄÉÀ̼ǿ¡¼­ ÇÊ¿äÇÑ º¯¼öµéÀÌ µé¾îÀÖ½À´Ï´Ù.

¿¹¸¦µé¾î gcc¸¦ ¼³Ä¡ÇßÀ»¶§ ebuild¿¡ ÀÇÇØ ¸¸µé¾îÁø 05gcc¶ó ºÒ¸®¿ì´Â ÆÄÀÏ¿¡´Â ´ÙÀ½ÀÇ º¯¼öµéÀÇ Á¤ÀÇ°¡ µé¾îÀÖ½À´Ï´Ù.

¿¹Á¦ 2-1 : /etc/env.d/05gcc
PATH="/usr/i686-pc-linux-gnu/gcc-bin/3.2"
ROOTPATH="/usr/i686-pc-linux-gnu/gcc-bin/3.2"
MANPATH="/usr/share/gcc-data/i686-pc-linux-gnu/3.2/man"
INFOPATH="/usr/share/gcc-data/i686-pc-linux-gnu/3.2/info"
CC="gcc"
CXX="g++"
LDPATH="/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3"

´Ù¸¥ ¹èÆ÷ÆÇÀº º¯°æ»çÇ×À» ¾Ë·ÁÁְųª ¸î¸î ȯ°æ º¯¼ö Á¤ÀǸ¦ /etc/profile¿¡ ´Ù ³Ö°Å³ª ´Ù¸¥ À§Ä¡¿¡ ³Ö½À´Ï´Ù. Á¨Åõ´Â ¹Ý¸é¿¡ »ç¿ëÀÚ ¿©·¯ºÐ(±×¸®°í ¶ÇÇÑ Æ÷ƼÁö)À» À§ÇØ °ü¸®Çϱ⠽±°Ô ¸¸µé¾ú°í ȯ°æº¯¼ö´Â ȯ°æº¯¼ö¸¦ ÀúÀåÇÒ ¼ö ÀÖ´Â ¼ö¸¹Àº ÆÄÀÏ¿¡ ½Å°æ¾²´Â °Í ¾øÀÌ °ü¸®ÇÕ´Ï´Ù.

¿¹¸¦ µé¾î gcc°¡ °»½Å µÇ¾úÀ»¶§, /etc/env.d/05gcc ÆÄÀϵµ »ç¿ëÀÚ¿ÍÀÇ »óÈ£ÀÛ¿ë¿¡ ÀÇÇÑ ¿äû ¾øÀÌ °»½ÅµË´Ï´Ù.

ÀÌ´Â Æ÷ƼÁöÀÇ ÀÕÁ¡ÀÏ »Ó¸¸ ¾Æ´Ï¶ó »ç¿ëÀڷμ­ÀÇ ÀÕÁ¡À̱⵵ ÇÕ´Ï´Ù. °æ¿ì¿¡ µû¶ó ½Ã½ºÅÛ ¹üÀ§¿µ¿ª¿¡¼­ ¾î¶² ȯ°æº¯¼ö¸¦ ¼³Á¤Çϵµ·Ï ¿äûÇÒÁöµµ ¸ð¸¨´Ï´Ù. ¿¹Á¦¿¡¼­¿Í °°ÀÌ ¿ì¸®´Â http_proxy º¯¼ö¸¦ Àâµµ·Ï ÇÏ°Ú½À´Ï´Ù. /etc/profileÀ» °Å´ëÇÏ°Ô ºÎÇ®¸®´Â ´ë½Å¿¡, ´ÜÁö /etc/env.d/99local ÆÄÀÏÀ» ¸¸µé°í ´ÙÀ½ÀÇ Á¤Àdz»¿ëÀ» ÀÔ·ÂÇÒ ¼ö ÀÖ½À´Ï´Ù.

¿¹Á¦ 2-2 : /etc/env.d/99local
http_proxy="proxy.server.com:8080"

µ¶ÀÚ ¿©·¯ºÐÀÇ ¸ðµç º¯¼öµéÀ» ¾²±â À§ÇØ °°Àº ÆÄÀÏ »ç¿ëÇÔÀ¸·Î½á, µ¶ÀÚ¿©·¯ºÐ ÀÚ½ÅÀÌ Á¤ÀÇ»ê º¯¼öµéÀ» »¡¸® ÈȾ ¼ö ÀÖ½À´Ï´Ù.

1.2.2. env-update ½ºÅ©¸³Æ®

/etc/env.dÀÇ ¸¹Àº ÆÄÀϵéÀº PATHº¯¼ö¸¦ Á¤ÀÇÇÕ´Ï´Ù. ÀÌ´Â À߸øµÈ °ÍÀÌ ¾Æ´Õ´Ï´Ù. env-update¸¦ µ¶ÀÚ¿©·¯ºÐÀÌ ½ÇÇàÇÒ¶§ À̴ ȯ°æº¯¼ö¸¦ °»½ÅÇϱâÀü¿¡ ¼ö¸¹Àº Á¤ÀǸ¦ ºÙÀÌ°Ô µÉ °ÍÀÌ°í, ±×°ÍÀ¸·Î ÀÎÇØ ÆÐÅ°Áö¸¦ µ¶ÀÚ¿©·¯ºÐ ÀÚ½ÅÀÇ È¯°æ º¯¼ö ¼³Á¤¿¡ ÀÌ¹Ì Á¸ÀçÇÏ´Â °ª¿¡ ¹æÇعÞÁö ¾Ê°í ½±°Ô Ãß°¡ÇÒ ¼ö ÀÖµµ·Ï ÇÕ´Ï´Ù.

env-update ½ºÅ©¸³Æ®´Â /etc/env.d ÆÄÀϵ鿡 ¾ËÆĺª ¼ø¼­´ë·Î °ªÀÌ ºÙÀ» °ÍÀÔ´Ï´Ù. ÆÄÀÏ À̸§Àº µÎÀÚ¸® ¼ýÀÚ·Î ½ÃÀ۵Ǿî¾ß¸¸ ÇÕ´Ï´Ù.

¿¹Á¦ 2-3 : env-update¿¡ ÀÇÇØ »ç¿ëµÇ´Â °»½Å¼ø¼­
         00basic        99kde-env       99local
     +-------------+----------------+-------------+
PATH="/bin:/usr/bin:/usr/kde/3.2/bin:/usr/local/bin"

º¯¼öÀÇ º´ÇÕÀº Ç×»ó ÀϾ´Â °ÍÀÌ ¾Æ´Ï¶ó ´ÙÀ½ º¯¼ö¿¡ ´ëÇØ ÀϾ´Ï´Ù. KDEDIRS, PATH, LDPATH, MANPATH, INFODIR, INFOPATH, ROOTPATH, CONFIG_PROTECT, CONFIG_PROTECT_MASK, PRELINK_PATH, PRELINK_PATH_MASK. ´Ù¸¥ ¸ðµç º¯¼öµéÀ» À§ÇØ ÃÖ±Ù Á¤ÀÇµÈ °ª(/etc/env.d¿¡ ÀÖ´Â ÆÄÀϵéÀÇ ¾ËÆĺª ¼ø¼­´ë·Î)ÀÌ »ç¿ëµË´Ï´Ù.

env-update¸¦ ½ÇÇàÇÒ¶§ ½ºÅ©¸³Æ®´Â ¸ðµç ȯ°æº¯¼ö¸¦ ¸¸µé°ÍÀÌ°í ±×µéÀ» /etc/profile.env(/etc/profile¿¡ ÀÇÇØ »ç¿ëµË´Ï´Ù)¿¡ ³õÀ» °ÍÀÔ´Ï´Ù. ÀÌ ¶ÇÇÑ LDPATH º¯¼ö·ÎºÎÅÍ Á¤º¸¸¦ ÃßÃâÇÏ¿© /etc/ld.so.conf¸¦ ¸¸µå´Âµ¥ »ç¿ëµË´Ï´Ù. ÀÌ ´ÙÀ½¿¡´Â µ¿Àû ¸µÄ¿¿¡ ÀÇÇØ »ç¿ëµÉ /etc/ld.so.cache¸¦ Àç»ý¼ºÇϱâ À§ÇØ ldconfig¸¦ ½ÇÇàÇÒ °ÍÀÔ´Ï´Ù.

env-updateÀÇ È¿°ú¸¦ ½ÇÇàÈÄ Áï½Ã ´«À¸·Î º¸°í ½Í´Ù¸é ȯ°æÀ» ¾÷µ¥ÀÌÆ®Çϱâ À§ÇØ ´ÙÀ½¸í·ÉÀ» ½ÇÇàÇÕ´Ï´Ù. Á÷Á¢ Á¨Åõ¸¦ ¼³Ä¡ÇÑ »ç¿ëÀںеéÀ̶ó¸é ¾Æ¸¶ ¼³Ä¡°úÁ¤À¸·ÎºÎÅÍ ´ÙÀ½À» ±â¾ïÇÒ °ÍÀÔ´Ï´Ù.

¿¹Á¦ 2-4 : ȯ°æ °»½Å
# env-update && source /etc/profile

À¯ÀÇ»çÇ× : À§ÀÇ ¸í·ÉÀº ´ÜÁö ÇöÀç Å͹̳ΰú »õ·Î¿î ÄÜ¼Ö ±×¸®°í ±×µéÀÇ ÀÚ½Ä ÄܼÖÀÇ º¯¼ö¿¡ ÇÑÇؼ­¸¸ °»½ÅÇÕ´Ï´Ù. ±×·¡¼­ X11¿¡¼­ ÀÛ¾÷ÇÏ´Â °æ¿ì source /etc/profileÀ» ¸Å »õ·Î¿î Å͹̳ÎÀ» ¿­¶§¸¶´Ù ȤÀº X¸¦ ´Ù½Ã ½ÃÀÛÇÒ¶§¸¶´Ù ÀÏÀ̸® ÃÄÁÙ ÇÊ¿ä°¡ ÀÖ¾î ¸ðµç »õ·Î¿î Å͹̳¯Àº »õ·Î¿î º¯¼ö¸¦ ±Ù¿ø¿ä¼Ò·Î °®½À´Ï´Ù. ¸¸¾à ·Î±ä ¸Å´ÏÀú¸¦ »ç¿ëÇÑ´Ù¸é ·çÆ®·Î µé¾î¿Í¼­ /etc/init.d/xdm restart¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿Í ±×·¸Áö ¾ÊÀ¸¸é ·Î±×¾Æ¿ôÇÏ°í »õ·Î¿î º¯¼ö °ªÀ¸·Î ÀÚ½Ä Å͹̳ο¡ º¯¼ö°ªÀ» »Ñ¸®±â À§ÇØ X·Î ´Ù½Ã ·Î±×ÇÒ ÇÊ¿ä°¡ ÀÖÀ» °ÍÀÔ´Ï´Ù.

Áß¿ä : ´Ù¸¥ º¯¼ö¸¦ Á¤ÀÇÇÒ¶§ ½© º¯¼ö´Â »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù. ÀÌ´Â FOO="$BAR"($BAR´Â ´Ù¸¥ º¯¼öÀÔ´Ï´Ù)¿Í °°Àº°ÍÀÌ ±ÝÁöµÈ´Ù´Â ÀǹÌÀÔ´Ï´Ù.

1.3. Áö¿ªÀû º¯¼ö Á¤ÀÇ

1.3.1. »ç¿ëÀÚ ÁöÁ¤

ȯ°æº¯¼ö¸¦ Àü¿ªÀûÀ¸·Î Á¤ÀÇÇϴ°ÍÀ» Ç×»ó ¿øÇÏ´Â°Ç ¾Æ´Ò °ÍÀÔ´Ï´Ù. ¿¹¸¦ µé¾î /home/my_user/bin°ú ÇöÀç ÀÛ¾÷µð·ºÅ丮 (µ¶ÀÚ¿©·¯ºÐÀÌ ÀÖ´Â ¹Ù·Î "ÀÌ" µð·ºÅ丮) ¸¦ PATH º¯¼ö¿¡ »õ·ÎÃß°¡ÇÏ±æ ¿øÇÒÁöµµ¸ð¸£°ÚÁö¸¸, °°Àº ½Ã½ºÅÛ¿¡ ÀÖ´Â ¸ðµç ´Ù¸¥ »ç¿ëÀÚµéÀÌ ±×µé¸¸ÀÇ PATH¸¦ °¡Áö´Â°ÍÀ» ¿øÇÏÁö´Â ¾ÊÀ» °ÍÀÔ´Ï´Ù. ȯ°æº¯¼ö¸¦ Áö¿ªÀûÀ¸·Î Á¤ÀÇÇÏ·Á¸é ~/.bashrc ³ª ~/.bash_profile¸¦ »ç¿ëÇÏ¸é µÉ °ÍÀÔ´Ï´Ù.

¿¹Á¦ 3-1 : ~/.bashrcÀÇ Áö¿ªÀû »ç¿ëÀ» À§ÇÑ PATH È®Àå
(A colon followed by no directory is treated as the current working directory)
PATH="${PATH}:/home/my_user/bin:"

Àç·Î±äÇϸé, PATH º¯¼ö°¡ °»½ÅµÉ °ÍÀÔ´Ï´Ù.

1.3.2. ¼¼¼Ç ÁöÁ¤

½ÉÁö¾î ¶§·Î´Â ¾öÇÑ Á¤ÀÇ°¡ ¿ä±¸µÉ ¶§µµ ÀÖ½À´Ï´Ù. ¾Æ¸¶µµ ¹ÙÀ̳ʸ® ÀڽŵéÀÇ °æ·Î¸¦ »ç¿ëÇÏÁö ¾Ê°Å³ª ȤÀº µ¶ÀÚ¿©·¯ºÐµé¿¡°Ô Àá±ñ ÇÊ¿äÇÑ ÀÌÀ¯·Î ~/.bashrc¸¦ ÆíÁýÇÏÁö ¾Ê°í µ¶ÀÚ¿©·¯ºÐµéÀÌ ¸¸µé¾î³õÀº Àӽà µð·ºÅ丮·ÎºÎÅÍ ¹ÙÀ̳ʸ®¸¦ »ç¿ëÇÒ ¼ö ÀÖ°Ô ÇÏ°í ½Í¾îÇÒ °ÍÀÔ´Ï´Ù.

ÀÌ·± °æ¿ì ´ÜÁö PATHº¯¼ö¸¦ ÇöÀç ¼¼¼Ç¿¡ export ¸í·ÉÀ» ÀÌ¿ëÇÏ¿© Á¤ÀÇÇÒ ¼ö ÀÖ½À´Ï´Ù. ·Î±×¾Æ¿ôÇÏÁö ¾Ê´Âµ¿¾ÈÀº PATH º¯¼ö´Â Àӽà ¼³Á¤³»¿ëÀ¸·Î °è¼Ó »ç¿ëµÉ °ÍÀÔ´Ï´Ù.

¿¹Á¦ 3-2 : ¼¼¼Ç ÁöÁ¤ ȯ°æº¯¼öÀÇ Á¤ÀÇ
# export PATH="${PATH}:/home/my_user/tmp/usr/bin"


ID
Password
Join
Enjoy your life; be pleasant and gay, like the birds in May.


sponsored by andamiro
sponsored by cdnetworks
sponsored by HP

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2009-05-03 16:09:58
Processing time 0.0058 sec