问题描述:Ubuntu系统突然断网、不接显示屏过一会网络就断了
解决方法:禁用系统休眠和挂起
配置步骤:
1、禁用休眠
1)创建 /etc/polkit-1/localauthority/90-mandatory.d/disable-hibernate.pkla 文件
sudo touch /etc/polkit-1/localauthority/90-mandatory.d/disable-hibernate.pkla
2)使用vi、vim、nano 等任一命令将如下内容添加到 /etc/polkit-1/localauthority/90-mandatory.d/disable-hibernate.pkla 文件
[Disable hibernate (upower)]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=no
ResultInactive=no
ResultAny=no
[Disable hibernate (logind)]
Identity=unix-user:*
Action=org.freedesktop.login1.hibernate
ResultActive=no
[Disable hibernate for all sessions (logind)]
Identity=unix-user:*
Action=org.freedesktop.login1.hibernate-multiple-sessions
ResultActive=no
3)重启系统使其生效
reboot
2、禁用挂起
1)创建 /etc/polkit-1/localauthority/90-mandatory.d/disable-suspend.pkla 文件
sudo touch /etc/polkit-1/localauthority/90-mandatory.d/disable-suspend.pkla
2)使用vi、vim、nano 等任一命令将如下内容添加到 /etc/polkit-1/localauthority/90-mandatory.d/disable-suspend.pkla 文件
[Disable suspend (upower)]
Identity=unix-user:*
Action=org.freedesktop.upower.suspend
ResultActive=no
ResultInactive=no
ResultAny=no
[Disable suspend (logind)]
Identity=unix-user:*
Action=org.freedesktop.login1.suspend
ResultActive=no
[Disable suspend for all sessions (logind)]
Identity=unix-user:*
Action=org.freedesktop.login1.suspend-multiple-sessions
ResultActive=no
3)重启系统使其生效
reboot
参考来源 https://sites.google.com/site/easytipsforlinux/disable-hibernate-and-suspend