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. SQLite-C#-帮助类

    public static class SQLiteHelper { private static string connectionString = string.Empty; #region vo ...

  2. 4.scala中的类

    版权申明:转载请注明出处.文章来源:http://bigdataer.net/?p=269 排版乱?请移步原文获得更好的阅读体验 1.针对不同字段生成的方法 字段生成的方法备注 var/val nam ...

  3. php获取经纬度

    <?php header("content-type:text/html;charset=utf-8"); function ipjwd() { $getIp=$_SERVE ...

  4. Asp.Net将Session保存在数据库中

    1.由于项目dll文件变动比较频繁,而保存登陆的状态又保存在Session中,所以导致用户经常无故掉线.(dll变动的时候导致Session丢失) 2.有一种方法可以长期保存session,那就是se ...

  5. MySQL5.7 半同步复制

    一.概述 5.5与5.7的半同步复制可能存在差异,从MySQL5.5开始,MySQL以插件的形式支持半同步复制 异步:默认情况下,MySQL复制是异步的.主库在执行完客户端提交的事务后会立即将结果返给 ...

  6. Java新建线程的3种方法

    Java新建线程的3种方法 =================== Java创建线程有3种方法:(1)继承Thread;(2)实现Runnable接口:(3)实现Callable接口; 由于Java只 ...

  7. CentOS查看CPU、内存、版本等系统信息

    CentOS查看系统信息 一:查看CPU more /proc/cpuinfo | grep "model name" grep "model name" /p ...

  8. docker自建仓库Registry

    因为生产情况下官方容器还是比较慢的,所以会用到自建docker仓库.docker官方提供完整部署仓库的容器,你只需要提供域名证书,把文件系统挂载到容器,一个用户密码文件就可以使用基本的仓库功能了. 启 ...

  9. 设计模式--桥梁模式C++实现

    1定义 将抽象和实现解耦,使得两者可以独立变化 2类图 3实现 #pragma once #include<iostream> using namespace std; class Imp ...

  10. Vue实例的生命周期created和mounted的区别

    生命周期先上图 什么是生命周期 Vue实例有一个完整的生命周期,也就是从开始创建.初始化数据.编译模板.挂载Dom.渲染→更新→渲染.卸载等一系列过程,我们称这是Vue的生命周期.通俗说就是Vue实例 ...