You are not logged in.

#1 2014-12-15 16:53:17

grobar87
Member
From: Македонија
Registered: 2010-08-25
Posts: 172

Problem with shutdown.

(Sorry for my bad english)
Hi,
When i want to shutdown my laptop it's restarts instead of shutdown. My laptop is Acer Aspire V5-571.I have tried every linux distro and same problem.
Finally i find a fix.When i execute the command below it shutdown properly.

for i in /sys/bus/usb/devices/*/power/control;
    do echo on > $i
done

Now all i have to do is to run this command at shutdown.I find on web solution for Fedora Linux.So i have to create a 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}"nk
    exit 1
    ;;
esac
exit 0

Then added the script as a service with:

sudo chkconfig --add haltusbpower

But this is fix for Fedora.Can someone help me to modified this to work with Arch?
Thanks.


And... here... we... go!

Offline

#2 2014-12-16 03:03:03

linuxuser21
Member
Registered: 2014-01-02
Posts: 8

Re: Problem with shutdown.

From https://bbs.archlinux.org/viewtopic.php?id=133108

bazenga wrote:

With systemd the shutdown hook isn't executed anymore; create the following files to fix this:

/usr/local/bin/shutdown-power-management.sh

#!/bin/bash

# A script to act as a workaround for the bug in the runtime power
# management module, which causes thinkpad laptops to restart after
# shutting down.

# Bus list for the runtime power management module. Probably shouldn't
# touch this.
buslist="pci i2c"

for bus in $buslist; do                                                             
  for i in /sys/bus/$bus/devices/*/power/control; do                              
    echo on > $i
  done
done

/etc/systemd/system/laptop-mode-tools.service

.include /usr/lib/systemd/system/laptop-mode-tools.service

[Service]
ExecStopPost=/bin/rm -f /var/run/laptop-mode-tools/enabled ; /usr/local/bin/shutdown-power-management.sh

After you created the files, execute systemctl daemon-reload

Last edited by linuxuser21 (2014-12-16 03:10:33)

Offline

Board footer

Powered by FluxBB