【备份】 解决acer v5 471g arch关机后自动重启的问题
Fedora 17 on an Aspire V5-571 -- Reboot on Shutdown
13 FEBRUARY 2015
Update on 2/13/15:
This article was originally posted on 08/12/2012 on my old blog (http://www.pbehnke.com/main/node/11). I've copied and pasted
most of it from the original. However, there's an update at the bottom for Arch users.
Original Post for Fedora
I recently purchased a new Acer Aspire V5-571 laptop. This laptop itself is beautiful. It has a new ivy bridge processor, 6GB RAM, 15.6in display, full number pad, and is super thin without the price tag of an ultrabook. Naturally, the first thing I did when I received it was wipe Windows and install Linux. Wanting to try something new, and a little less painful than an Arch install, I opted for Fedora 17 with KDE. The installation went pretty smooth with no major problems. I didn't realize the bottom of the touchpad had two click buttons, so I spend a little time editing the Xorg conf file to add tap to click and double tap to right click. Other than that, all the hardware seems to work out of the box. There was one major problem I did find when I went to shut down the laptop: when shutting down, the laptop always rebooted. The power light would turn off, and about 3 seconds later, it would start to boot again. For a couple days, I tried a couple solutions I found online for this problem. I tried turning off network boot in the BIOS, loading a watchdog timer module, shutting down with and without the AC adapter plugged in, all with no success. I was about to lose hope, but I discovered that the laptop would always shutdown correctly if any USB device was attached. I remembered one posting I saw on the Arch forums about someone who had a similar problem but with the I2C and SPI buses (https://bbs.archlinux.org/viewtopic.php?id=133108). He found that shutting off power management to those buses allowed him to shutdown correctly. I tried his approach with the USB bus system with the following command:
for i in /sys/bus/usb/devices/*/power/control;
do echo on > $i
done
After running this I could shutdown and it the computer would not turn itself back on. Now all I had to do was run this command at shutdown. This was a little tricky, having never used Fedora or systemd. Simply making an init script in /etc/rc5.d/ did not work. With a little help from the post at http://ask.fedoraproject.org/question/904/start-script-on-boot-fedora-16, I ended up having to create the following bash script in /etc/init.d/haltusbpower
#! /bin/bash
#
# haltusbpower init script
#
# chkconfig: 345 99 20
# description: A script to act as a workaround for the bug in the runtime power management module, which causes my acer aspire v5-571 laptop to restart after shutting down.
#
### BEGIN INIT INFO
# Provides: haltusbpower
# Default-Stop: 0 1 3 5
# Short-Description: Halt USB Powersave mode
# Description: A script to halt usb power control.
### END INIT INFO
# Source function library.
. /etc/init.d/functions
# Bus list for the runtime power management module.
buslist="usb"
# See how we were called.
case "$1" in
start)
echo "USB bug fix active"
#no-op on startup
;;
stop)
echo "Turning off USB Power Control"
for bus in $buslist; do
for i in /sys/bus/$bus/devices/*/power/control; do
echo on > $i
done
done
;;
*)
echo "Usage: /etc/init.d/haltusbpower {start|stop}"
exit 1
;;
esac
exit 0
Then added the script as a service with:
sudo chkconfig --add haltusbpower
After doing all this, everything is working as it should with no issues on shutdown.
Update (2/13/15) for Arch/systemd users:
@jasonnguyen_ on twitter recently tweeted at me with an update for Arch and systemd users. His approach has been documented here. I've copied and pasted his script here:
This is a script to stop power from being transfered to usb ports and turning the laptop back on after shutdown. This is for laptops running systemd.
1. Make an executable script here
/usr/local/bin/haltusbpower.sh
----------
#!/bin/bash
for i in /sys/bus/usb/devices/*/power/control;
do echo on > $i
done
----------
2. Make the script executable with the command "chmod +x /usr/local/bin/haltusbpower.sh
3. Make this script run on shutdown with systemd. Make this file here.
/usr/lib/systemd/system/haltusbpower.service
----------
[Unit]
Description=haltusbpower
Before=shutdown.target
DefaultDependencies=no
[Service]
ExecStart=/usr/local/bin/haltusbpower.sh
Type=oneshot
RemainAfterExit=yes
[Install]
WantedBy=shutdown.target
----------
4. Enable the systemd service with "systemctl enable haltusbpower.service"
【备份】 解决acer v5 471g arch关机后自动重启的问题的更多相关文章
- FreeBSD关机后自动重启的解决办法
我用的是华硕的笔记本电脑,不知道别的电脑有没有这个情况,按handbook关机指令为shutdown -p now,但是我执行这个指令后电脑却自动重启,用Linux关机指令shutdown -h no ...
- (转)完美解决 Android WebView 文本框获取焦点后自动放大有关问题
完美解决 Android WebView 文本框获取焦点后自动放大问题 前几天在写一个项目时,要求在项目中嵌入一个WebView 本来很快就完成了,测试也没有问题.但发给新加坡时,他们测试都会出现文本 ...
- win10关机之后自动重启(系统更新之后出现这个问题)
最近更新了一把win10之后出现无法关机,关机之后直接又开机,无限循环状态.最近几天没空处理一直是强关笔记本下班的. 今天打了一把命令: shutdown /s /t 0 发现关机正常,本来打算整个脚 ...
- Java线程监听,意外退出线程后自动重启
Java线程监听,意外退出线程后自动重启 某日,天朗气清,回公司,未到9点,刷微博,顿觉问题泛滥,惊恐万分! 前一天写了一个微博爬行程序,主要工作原理就是每隔2分钟爬行一次微博,获取某N个关注朋友微博 ...
- 001windows已遇到一个关键性问题 一分钟后自动重启
重装了系统Window7,出现了如题的提示"windows已遇到一个关键性问题 一分钟后自动重启" 查找原因: 通过事件管理器可以查看如上提示遇到的问题.一般是因为一些系统的服务没 ...
- linux上监控tomcat down掉后自动重启tomcat
p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px "Helvetica Neue"; color: #454545 } p. ...
- 监控windows服务,当服务停止后自动重启服务
近期花时间研究了一下windows和linux下某服务停了后自动重启的功能,在网上收集了些资料,并经过测试,在此整理一下.这里介绍的是windows服务的监控,是通过批处理来实现的.本例是监控wind ...
- py脚本修改后自动重启
在用socket.io, pika之类启动一个脚本死循环做server或者client的时候: 1脚本被编辑之后,是不会自动重启 2当代码报错的时候,会立即退出, 只能手动重新运行 python ap ...
- 【转】Android Service被关闭后自动重启,解决被异常kill 服务
http://www.kaifajie.cn/android/10182-2.html 每次调用startService(Intent)的时候,都会调用该Service对象的onStartComman ...
随机推荐
- 利用shell编程,部署项目到服务器
现在在前后端分离的开发形式中,每次前端将VUE项目打包之后,需要后端程序员部署到服务器上.这过程为何没有用git,因为每次vue打包后的文件都不相同与前一次打包,git为何的话,会包含过大迭代版本,同 ...
- codeforce diversity
2017-08-25 14:59:34 writer:pprp 题意如下:给你一个串字符,再给你一个数字,表示在字符串中的各不相同的字符个数, 问你最少需要改变几个字符达到要求,不能达到要求就输出im ...
- 03_zookeeper伪集群安装
一句话说明白:在1台机器上模拟多台机器,对外提供服务 在理解zookeeper集群安装方法的基础上,本文描述如何将1个机器模拟为3个节点的zookeeper集群,建议先参考阅读本文的前一期 zooke ...
- ABP 源码分析汇总之 IOC
IOC的优点: 1. 依赖接口,而非实现,如下代码, 这样的好处就是,客户端根本不知道PersonService的存在,如果我们换一下IPersonService的实现,客户端不用任何修改, 说的简单 ...
- WinCE数据通讯之SqlCE数据同步篇
上一篇总结了WinCE通过WebService进行数据通讯的交互方式,今天整理个SqlCE数据同步方式的内容.先说下软件环境:终端平台使用WinCE5.0+SqlCE2.0,服务器使用Windows ...
- 安装 inotify-tools
摘要 inotify-tools, 是一款google出的用于监控文件系统的软件. 一.软件下载地址官方站点地址:http://inotify-tools.sourceforge.net/仓库地址:h ...
- 1-16-2 LVM管理和ssm存储管理器使用&磁盘配额
ssm存储管理器使用&磁盘配额 ssm存储管理器使用 系统存储管理器的使用 系统存储管理器(又称ssm,即system-storage-manager),是RHEL7/CentOS7新增的功能 ...
- 为什么需要超出48K的音频采样率,以及PCM到DSD的演进
网上很多观点说,根据采样定理,48K的音频采样率即可无损的表示音频模拟信号(人耳最多可以听到20K的音频),为何还需要96K, 192K等更高的采样率呢?最先我也有这样的疑问,毕竟采样定理是经过数学家 ...
- 安装Linux环境
虚拟机:虚拟机(Virtual Machine),在计算机科学中的体系结构里,是指一种特殊的软件,他可以在计算机平台和终端用户之间建立一种环境,而终端用户则是基于这个软件所建立的环境来操作软件.在计算 ...
- VB.Net日期格式化的5种使用方法
VB.Net日期(时间)格式化的5种使用方法 以下时间以2009年9月26号为例 第1种格式 : dd/MM/yyyy String.Format("{0:dd/MM/yyyy}&q ...