VectorLinux

Please login or register.

Login with username, password and session length
Advanced search  

News:

Visit our home page for VL info. For support and documentation, visit the Vector Linux Knowledge Center or search the Knowledge Center and this Forum using the search box above.

Pages: 1 ... 6 7 [8]

Author Topic: VectorLinux5.9-rc2 bugs/annoyances  (Read 26004 times)

rbistolfi

  • Packager
  • Vectorian
  • ****
  • Posts: 2301
Re: VectorLinux5.9-rc2 bugs/annoyances
« 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
Re: VectorLinux5.9-rc2 bugs/annoyances
« Reply #106 on: December 03, 2007, 07:10:05 pm »

easuter has provided some scripts.

/etc/acpi/acpi_handler.sh
Code: [Select]
#!/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: [Select]
#!/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: [Select]
## 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]