Linux之 4 种休眠模式

目录

  • 1. Linux之 4 种休眠模式

1. Linux之 4 种休眠模式

# echo standby >/sys/power/state //CPU和RAM在运行
# echo mem > /sys/power/state  //挂起到内存(待机),关闭硬 盘、外设等设备
# echo disk > /sys/power/state //挂起到硬盘(休眠),关闭硬盘、外设等设备,进入关机状态。此时计算机
完全关闭,不耗电 
# echo on > /sys/power/state  //退出休眠
# echo +10 > /sys/class/rtc/rtc0/wakealarm //10s后rtc唤醒cpu
 
- On(on)                  S0 -  Working
- Standby (standby)       S1 -  CPU and RAM are powered but not executed
- Suspend to RAM(mem)      S3 -  RAM is powered and the running content is saved to RAM
- Suspend to Disk,Hibernation(disk) S4 -  All content is saved to Disk and power down
 
2.查看电源状态
//查看当前睡眠情况
# cat /sys/power/state
 
//查看当前那些占用了阻止深度睡眠的wake lock                                                                           
# cat /sys/power/wake_lock      
 
//查看wake lock状态情况                                                           
# cat /sys/proc/wakelocks
 
//手动释放一次名称为“PowerManagerSerivce”的wake lock引用次数-1,为0时进入睡眠                                                                     
#cat "PowerManagerService" > /sys/power/wake_unlock             

你可能感兴趣的:(#,linux,linux,java,服务器,sleep,power)