VectorLinux
October 22, 2014, 08:12:20 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to http://vectorlinux.com/forum1. The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
 
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: 1 ... 6 7 [8]
  Print  
Author Topic: VectorLinux5.9-rc2 bugs/annoyances  (Read 24161 times)
rbistolfi
Packager
Vectorian
****
Posts: 2288


« Reply #105 on: December 03, 2007, 06:52:57 pm »

I'm don't know how to activate that with lid closure although it is probably possible.
HTH,
Mike

I think is possible using acpid

You have to make a configuration file which will match acpi events with a cli script. The acpi events are logged in /var/log/messages, so a tail -f could give some clue if a acpi messagge is sent at lid closure.
Check http://www.gentoo.org/doc/en/power-management-guide.xml
Logged

"There is a concept which corrupts and upsets all others. I refer not to Evil, whose limited realm is that of ethics; I refer to the infinite."
Jorge Luis Borges, Avatars of the Tortoise.

--
Jumalauta!!
uelsk8s
Administrator
Vectorian
*****
Posts: 2504



« Reply #106 on: December 03, 2007, 07:10:05 pm »

easuter has provided some scripts.

/etc/acpi/acpi_handler.sh
Code:
#!/bin/sh

# Default acpi script that takes an entry for all actions



IFS=${IFS}/

set $@

LIDSTATE=$(/bin/sed -ne "/state:/{s/^state:[ ]*\([a-zA-Z]*\)$/\1/p;q}" \

/proc/acpi/button/lid/LID/state)



case "$1" in

  button)

    case "$2" in

power)

if [ "$LIDSTATE" == "open" ]; then

/usr/sbin/presusp

    hibernate -F /etc/hibernate/ram.conf

elif [ "$LIDSTATE" == "closed" ]; then

hibernate -F /etc/hibernate/ususpend-ram.conf

fi

         ;;

lid)

if [ "$LIDSTATE" == "closed" ]; then

/usr/sbin/presusp

hibernate -F /etc/hibernate/ram.conf

elif [ "$LIDSTATE" == "open" ]; then

hibernate -F /etc/hibernate/ususpend-ram.conf

fi

;;

*) logger "ACPI action $2 is not defined"

         ;;

    esac

    ;;

  *)

    logger "ACPI group $1 / action $2 is not defined"

    ;;

esac

/etc/rc.d/rc.acpid
Code:
#!/bin/sh

# Start/stop/restart acpid.



# Start acpid:

acpid_start() {

  if [ -x /usr/sbin/acpid -a -d /proc/acpi ]; then

    echo "Starting ACPI daemon:  /usr/sbin/acpid"

    /usr/sbin/acpid

  fi

}



# Stop acpid:

acpid_stop() {

  killall acpid

}



# Restart acpid:

acpid_restart() {

  acpid_stop

  sleep 1

  acpid_start

}



case "$1" in

'start')

  acpid_start

  ;;

'stop')

  acpid_stop

  ;;

'restart')

  acpid_restart

  ;;

*)

  echo "usage $0 start|stop|restart"

esac

after adding those and setting them executable you will need to add acpid to /etc/rc.d/rc.M like this
Code:
## Hardware initialisation
echocl "Initializing hardware" cyan
for RC in modules pnp acpid serial parallel alsa cdrom samba dbus; do

you also need the hibernate scripts
Logged
Pages: 1 ... 6 7 [8]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!