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关机后自动重启的问题的更多相关文章

  1. FreeBSD关机后自动重启的解决办法

    我用的是华硕的笔记本电脑,不知道别的电脑有没有这个情况,按handbook关机指令为shutdown -p now,但是我执行这个指令后电脑却自动重启,用Linux关机指令shutdown -h no ...

  2. (转)完美解决 Android WebView 文本框获取焦点后自动放大有关问题

    完美解决 Android WebView 文本框获取焦点后自动放大问题 前几天在写一个项目时,要求在项目中嵌入一个WebView 本来很快就完成了,测试也没有问题.但发给新加坡时,他们测试都会出现文本 ...

  3. win10关机之后自动重启(系统更新之后出现这个问题)

    最近更新了一把win10之后出现无法关机,关机之后直接又开机,无限循环状态.最近几天没空处理一直是强关笔记本下班的. 今天打了一把命令: shutdown /s /t 0 发现关机正常,本来打算整个脚 ...

  4. Java线程监听,意外退出线程后自动重启

    Java线程监听,意外退出线程后自动重启 某日,天朗气清,回公司,未到9点,刷微博,顿觉问题泛滥,惊恐万分! 前一天写了一个微博爬行程序,主要工作原理就是每隔2分钟爬行一次微博,获取某N个关注朋友微博 ...

  5. 001windows已遇到一个关键性问题 一分钟后自动重启

    重装了系统Window7,出现了如题的提示"windows已遇到一个关键性问题 一分钟后自动重启" 查找原因: 通过事件管理器可以查看如上提示遇到的问题.一般是因为一些系统的服务没 ...

  6. linux上监控tomcat down掉后自动重启tomcat

    p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px "Helvetica Neue"; color: #454545 } p. ...

  7. 监控windows服务,当服务停止后自动重启服务

    近期花时间研究了一下windows和linux下某服务停了后自动重启的功能,在网上收集了些资料,并经过测试,在此整理一下.这里介绍的是windows服务的监控,是通过批处理来实现的.本例是监控wind ...

  8. py脚本修改后自动重启

    在用socket.io, pika之类启动一个脚本死循环做server或者client的时候: 1脚本被编辑之后,是不会自动重启 2当代码报错的时候,会立即退出, 只能手动重新运行 python ap ...

  9. 【转】Android Service被关闭后自动重启,解决被异常kill 服务

    http://www.kaifajie.cn/android/10182-2.html 每次调用startService(Intent)的时候,都会调用该Service对象的onStartComman ...

随机推荐

  1. 07_MySQL DQL_多表查询_等值内连接

    #6:连接查询/*含义:多表查询,当查询的字段来自多个表 笛卡尔积: 表1,m行:表2,n行: 表1,表2 = m*n行发生原因:表1的每行和表2的n行拼接,形成n行,最终得到m*n行如何避免:增加连 ...

  2. 网络流learning

    上次学习网络流还是大一的下学期,之后就被从图论分出来交给队友了 然而吉林一战,队友在深圳读研而不能来,于是需要自己学习一下,争取在比赛前看完网络流建模汇总和一些总结,升华一下. 同时记录一下自己做过的 ...

  3. PHP实体层基础类

    PHP实体层基础类 class BaseModel { private $tableName; private $fields=array(); function __construct() { $t ...

  4. 机器学习笔记—Logistic 回归

    前面我们介绍了线性回归,为捕获训练集中隐藏的线性模型,提高预测准确率,我们寻找最佳参数 θ,使得预测值与真实值误差尽量小,也就是使均方误差最小.而经过验证,最小均方误差是符合最大似然估计理论的. 在 ...

  5. Memcached delete 命令

    Memcached delete 命令用于删除已存在的 key(键). 语法: delete 命令的基本语法格式如下: delete key [noreply] 多个 key 使用空格隔开,如下: d ...

  6. Hive -hivevar 参数传递

    命令行模式,或者说目录模式,可以使用hive 执行命令. 选项说明: -e : 执行短命令 -f :  执行文件(适合脚本封装) -S : 安静模式,不显示MR的运行过程 -hivevar : 传参数 ...

  7. SpringMvc中的校验框架@valid和@validation的概念及相关使用 和BindingResult bindingResult

    1.比较 @Valid是使用hibernate validation的时候使用 @Validated 是只用spring  Validator 校验机制使用\ 2.实现 其中,@valid,java的 ...

  8. Kotlin------类和对象(一)

    类声明 和Java一样,Kotlin中使用关键字class来声明一个类.如下即是声明一个最简单的没有任何属性和方法的类 // 没有任何属性.方法的Invoice 类 class Invoice {} ...

  9. layui弹窗宽度固定高度自适应界面

    //默认上下15px的边距高度,可根据需要修改function layuiDialogFitScreen(){ var layui_title_height=$(window.parent.docum ...

  10. torch Tensor学习:切片操作

    torch Tensor学习:切片操作 torch Tensor Slice 一直使用的是matlab处理矩阵,想从matlab转到lua+torch上,然而在matrix处理上遇到了好多类型不匹配问 ...