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. Flask-最简单的Python http服务框架使用

    环境准备 Python + pip + Flask sudo easy_install pip sudo pip install flask 代码如下(做了个jieba分词的服务) # encodin ...

  2. 转载 - POJ分类很好很有层次感

    from http://blog.csdn.net/zzycsx/article/details/49103451 OJ上的一些水题(可用来练手和增加自信) (poj3299,poj2159,poj2 ...

  3. windows系统下简单node.js环境配置 安装

    国内目前关注最高,维护最好的一个关于nodejs的网站应该是http://www.cnodejs.org/ windows系统下简单nodejs环境配置. 第一步:下载安装文件 下载地址:官网 htt ...

  4. Android开发-网络通信1

    使用 org.apache.http.client.HttpClient; 一开始从官网下载HttpClient 4.5:http://hc.apache.org/downloads.cgi ,解压之 ...

  5. char数组

    *****************************************************************char 类型的数组(c语言中是没有字符串的)char name[20 ...

  6. 备注Quartz触发器设置

    corn表达式时间格式: <!-- s m h d m w(?) y(?) -->, 分别对应: 秒>分>小时>日>月>周>年, ●星号(*):可用在所 ...

  7. cookie、session、sessionStorage、localStorage

    Cookie cookie是存储在浏览器端,并且随浏览器的请求一起发送到服务器端的,它有一定的过期时间,到了过期时间自动会消失. 首次设置cookie时是由服务器端发送到浏览器端 ,之后每次浏览器发送 ...

  8. ffmpeg播放RTSP的一点优化

    简单记录一下最近使用ffmpeg播放RTSP做的一点参数优化. 先做如下定义: AVDictionary* options = NULL; 1.画质优化 原生的ffmpeg参数在对1920x1080的 ...

  9. IOS UI-模态视图

    一.简单介绍 除了push之外,还有另外一种控制器的切换方式,那就是Modal 任何控制器都能通过Modal的形式展⽰出来 Modal的默认效果:新控制器从屏幕的最底部往上钻,直到盖住之前的控制器为⽌ ...

  10. mysql学习之旅

    1,mysql安装脚本 #!/bin/bash RSYNC='10.39.2.120::wenhui/database/install' CMAKE='cmake-2.8.6.tar.gz' MYSQ ...