![デスクトップの場合、UPowerパッケージは何を出力するか](https://rvso.com/image/31654/%E3%83%87%E3%82%B9%E3%82%AF%E3%83%88%E3%83%83%E3%83%97%E3%81%AE%E5%A0%B4%E5%90%88%E3%80%81UPower%E3%83%91%E3%83%83%E3%82%B1%E3%83%BC%E3%82%B8%E3%81%AF%E4%BD%95%E3%82%92%E5%87%BA%E5%8A%9B%E3%81%99%E3%82%8B%E3%81%8B.png)
Ubuntu 12.04 では、次のコマンドを使用します。
upower -i /org/freedesktop/UPower/devices/battery_BAT0
バッテリーのすべての統計が出力されます。ただし、デスクトップを使用している場合 (つまり、バッテリーがない場合) は何が出力されますか?
答え1
ワークステーションから:
$ upower -i /org/freedesktop/UPower/devices/battery_BAT0
出力:
failed to set path: cannot refresh: Cannot get device properties for
/org/freedesktop/UPower/devices/battery_BAT0: Couldn't call GetAll() to
get properties for /org/freedesktop/UPower/devices/battery_BAT0: Method
"GetAll" with signature "s" on interface "org.freedesktop.DBus.Properties"
doesn't exist
ハードウェアの詳細 - CPU
$ lscpu
Architecture: i686
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 3
On-line CPU(s) list: 0-2
Thread(s) per core: 1
Core(s) per socket: 3
Socket(s): 1
Vendor ID: AuthenticAMD
CPU family: 16
Model: 5
Stepping: 2
CPU MHz: 800.000
BogoMIPS: 5787.62
Virtualization: AMD-V
L1d cache: 64K
L1i cache: 64K
L2 cache: 512K
ハードウェアの詳細 - マザーボード
$ dmidecode -t baseboard
# dmidecode 2.11
SMBIOS 2.6 present.
Handle 0x0002, DMI type 2, 15 bytes
Base Board Information
Manufacturer: ASRock
Product Name: M3A785GMH/128M
Version:
Serial Number:
Asset Tag:
Features:
Board is a hosting board
Board is replaceable
Location In Chassis:
Chassis Handle: 0x0003
Type: Motherboard
Contained Object Handles: 0
Handle 0x0019, DMI type 41, 11 bytes
Onboard Device
Reference Designation: To Be Filled By O.E.M.
Type: Video
Status: Enabled
Type Instance: 0
Handle 0x001A, DMI type 41, 11 bytes
Onboard Device
Reference Designation: To Be Filled By O.E.M.
Type: SCSI Controller
Status: Disabled
Type Instance: 0
答え2
デスクトップに電源を供給するバッテリーがない場合でも、電源情報を提供する他のデバイスがある場合があります。たとえば、Apple iPad、Logitech Unifying HID、電源メーターはシステムにそれ以上の情報を提供しませんが、電源統計を報告できます。
に提供されたパスはupower -i
デスクトップ上に存在しないため (バッテリーがないため はありませんBAT0
)、明らかにエラーが発生して失敗します。
upower -d
以下はデスクトップ上の例です。充電式バッテリーを搭載した Logitech K800 キーボードがリストされています。
Device: /org/freedesktop/UPower/devices/keyboard_0003o046DoC52Bx000A
native-path: /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.2/0003:046D:C52B.0009/0003:046D:C52B.000A
vendor: Logitech, Inc.
model: K800
serial: FB841B86
power supply: no
updated: Wed 12 Feb 2014 12:11:10 PM CET (5 seconds ago)
has history: yes
has statistics: no
keyboard
present: yes
rechargeable: yes
state: discharging
percentage: 55%
History (charge):
1392203470 55.000 discharging
Daemon:
daemon-version: 0.9.23
can-suspend: no
can-hibernate: no
on-battery: no
on-low-battery: no
lid-is-closed: no
lid-is-present: no
is-docked: no