Linux 電源管理

来源:百度文库 编辑:神马文学网 时间:2024/04/29 15:26:49
Linux 電源管理
在 Server 即將邁向 Uptime 180 days 之際, 7/18 那天因海棠颱風的肆虐停電近五個小時...
目標: Uptime 365 days... 殘念!!
不過這也引出了 Linux 的電源管理問題: 如果能讓安裝於 Notebook 的 Linux Server 在電池電力耗盡前進入待命狀態 (Suspend), 並於市電恢復後自動回復到 on-line 狀態, 就是現成的不斷電系統囉!
<< APM (Advanced Power Management) >>
若 /proc/apm 檔案存在的話, 表示系統的電源管理模式為: APM
執行 apm 指令可查詢目前電力狀況: AC on-line, battery status high: 100%
apm daemon 設定檔在: /etc/sysconfig/apmd
<< ACPI (Advanced Configuration and Power Interface) >>
若 /proc/acpi 目錄存在的話, 表示系統的電源管理模式為: ACPI
以下是 FC3@Asus S5N (acpid-1.0.3-2) 的 ACPI 相關資訊:
/proc/acpi/ac_adapter/AC0/state
state: on-line / off-line
/proc/acpi/battery/BAT0/info
present: yes
design capacity: 47300 mWh
last full capacity: 36817 mWh
battery technology: rechargeable
design voltage: 11100 mV
design capacity warning: 4730 mWh
design capacity low: 2365 mWh
capacity granularity 1: 473 mWh
capacity granularity 2: 473 mWh
model number: S5N
serial number:
battery type: LIon
OEM info: ASUSTEK
/proc/acpi/battery/BAT0/state
present: yes
capacity state: ok
charging state: charging / charged
present rate: 12001 mW
remaining capacity: 34936 mWh
present voltage: 12655 mV
據說當 notebook 使用電池電力時, 輸入以下指令可增加約 5% 使用時間 (但效能會降低):
echo "1" > /proc/sys/vm/laptop_mode
技術文件:
ACPI 權威網站 (英文)Linux Center TechDoc: 電源管理在 Linux 上的應用Linux Center TechDoc: 電源管理在 Linux 上的應用-IIMini HOWTO:Battery Powered Linux - 3. 先進能源管理 APMGentoo Linux 文件 -- 電源管理指引Pank‘s Blog: Test ACPI and APM under Linux聯想北京工程師技術文件: linux 電源管理 (簡體中文)Gentoo Linux Wiki: BashScript - Suspend when battery is low (英文)
延伸閱讀:
LinuxHall 技術文章: 2.6 核心大改革Gentoo Linux Wiki - Hardware IndexJamyy‘s Weblog: 小氣架站 DIY: 用 Notebook 架 Server
套件下載:
APM RPM 套件下載 ACPI 套件下載:
http://acpid.sourceforge.net/
http://rpmfind.net/linux/rpm2html/search.php?query=acpidUPS 電源監控程式: powerd
Posted by Jamyy at 2005年07月20日 11:40