2009年1月13日 星期二

其他開機相關事項

  • 關於模組: /etc/modprobe.conf
    還記得我們在 /etc/rc.d/rc.sysinit 當中談到的載入使用者自訂模組的地方嗎?嘿嘿!就是在 /etc/sysconfig/modules/ 目錄下啊! 不過,雖然核心提供的預設模組已經很足夠我們使用了,但是, 某些條件下我們還是得對模組進行一些參數的規劃,此時,就得要使用到 /etc/modprobe.conf 囉! 舉例來說,鳥哥的 FC4 主機的 modprobe.conf 有點像這樣:
    [root@linux ~]# vi /etc/modprobe.conf
    alias eth0 8139too
    alias snd-card-0 snd-via82xx
    options snd-card-0 index=0
    options snd-via82xx index=0
    alias usb-controller uhci-hcd
    意思是說:『我的 eth0 這個玩意兒,代表的是使用 8139too 這個核心模組, 至於 snd-card-0 則使用 snd-via82xx 那個模組。此外, snd-card-0 這個模組在使用時, 還使用 index=0 這個參數。』這玩意真的是挺常用的~不過,這個檔案通常在安裝的時候, 安裝程式就會主動的建立這個檔案囉~除非您對系統提供的驅動程式模組不滿意~~ 才會主動的修改這個模組載入的相關檔案啦~(早期 2.4.xx 核心版本時,使用的是 /etc/modules.conf 喔!) 更多的相關說明,請 man modprobe.conf 喔!

  • /etc/sysconfig/*
    不說您也知道,整個開機的過程當中,老是讀取的一些服務的相關設定檔都是記錄在 /etc/sysconfig 目錄下的!那麼該目錄底下有些啥玩意兒?我們先來瞧一瞧!
    [root@linux ~]# ls -l /etc/sysconfig
    -rw-r--r-- 1 root root 194 Jun 25 08:53 authconfig
    -rw-r--r-- 1 root root 726 Apr 25 23:54 autofs
    -rw-r--r-- 1 root root 39 Jun 25 16:55 clock
    drwxr-xr-x 2 root root 4096 May 26 00:52 console
    -rw-r--r-- 1 root root 512 Jul 12 06:21 crond
    -rw-r--r-- 1 root root 14 Jun 25 08:53 desktop
    -rw-r--r-- 1 root root 31 Aug 23 03:13 diskdump
    -rw-r--r-- 1 root root 17 Jun 25 16:56 firstboot
    -rw-r--r-- 1 root root 25 Jun 25 08:53 grub
    -rw-r--r-- 1 root root 1592 Mar 2 2005 harddisks
    -rw-r--r-- 1 root root 112 Jun 25 19:53 i18n
    -rw-r--r-- 1 root root 991 Nov 2 2004 init
    -rw------- 1 root root 1376 Mar 19 2005 iptables-config
    -rw-r--r-- 1 root root 180 Jun 25 08:53 kernel
    -rw-r--r-- 1 root root 32 Jun 25 08:53 keyboard
    -rw-r--r-- 1 root root 168 May 20 03:54 kudzu
    drwxr-xr-x 2 root root 4096 May 26 00:52 modules
    -rw-r--r-- 1 root root 115 Jun 25 08:53 mouse
    -rw-r--r-- 1 root root 43 Jun 25 08:53 network
    drwxr-xr-x 4 root root 4096 Jun 25 08:27 networking
    drwxr-xr-x 2 root root 4096 Jun 25 21:53 network-scripts
    -rw-r--r-- 1 root root 454 May 20 00:07 syslog
    -rw-r--r-- 1 root root 66 Mar 7 2005 sysstat
    -rw-r--r-- 1 root root 376 Mar 9 2005 xinetd
    為了節省篇幅,上表當中我已經省略掉某些檔案了,僅列出較重要的幾個! 需要注意的是:
    • authconfig
      這個檔案主要在規範使用者的身份認證,包括加密與否、加密的機制等;

    • clock
      此檔案在設定 Linux 主機的時區,可以使用格林威治時間(GMT) ,也可以使用台灣的本地時間 ( local )。基本上,在 clock 檔案內的設定項目『 ZONE 』所參考的時區位於 /usr/share/zoneinfo 目錄下的相對路徑中。 而且要修改時區的話,還得將 /usr/share/zoneinfo/Asia/Taipei 這個檔案複製成為 /etc/localtime 才行!

    • desktop
      這個與預設的 X Window 的視窗管理員 (Window Manager) 有關。 在 FC4 裡頭預設是以 KDE 為主要的 WM,您也可以自行在這個檔案內修訂喔!

    • i18n
      i18n 在設定一些語系的使用方面,例如最麻煩的文字介面下的日期顯示問題! 如果您是以中文安裝的,那麼預設語系會被選擇 big5 ,所以在純文字介面之下, 你的檔案日期顯示就會呈現亂碼!這個時候就需要更改一下這裡啦!更動這個 i18n 的檔案,將裡面的 LC_TIME 改成 en 即可!

    • keyboard & mouse
      keyboard 與 mouse 就是在設定鍵盤與滑鼠的形式;

    • network
      network 可以設定主機名稱,以及 GATEWAY 這兩個重要資訊呢!

    • network-scripts/
      至於 network-scripts 裡面的檔案,則是主要用在設定網路卡~ 這部份我們在伺服器架設篇才再次提到!
    總而言之一句話,這個目錄下的檔案很重要的啦!開機過程裡面常常會讀取到的!
  •