Re: [gentoo-user] 'Hibernate' by power button

2007-02-17 Thread Mick
On Friday 16 February 2007 21:19, Alex Schuster wrote:
 Mick writes:
/etc/acpi/default.sh: line 57: syntax error: unexpected end of file
  The last few of lines of my /etc/acpi/default.sh show this much:
  ==
  ac_adapter)
  case $value in
  # Add code here to handle when the system is...
  #   ;;
 
  # Add code here to handle when the system is...
  # (maybe change cpu scaling to performance mode)
  #*1)
  #   ;;

 The inner case statement is not closed by an esac. This is missing (yes,
 log_unhandled comes twice):

   *)  log_unhandled $* ;;
   esac
   ;;

  *)  log_unhandled $* ;;
  esac

 emerge -1 acpid should also give you the defaut back. Do a quickpkg
 acpid before if you changed othr things for yourself you want to keep
 (this creates a binary package), you can then emerge it again later
 with emerge -1K acpid.

   Alex

Thank you all,  :)

The last two lines were missing as you noted above.  I've added them and the 
button now works fine.
-- 
Regards,
Mick


pgpAkHySa7C2D.pgp
Description: PGP signature


[gentoo-user] 'Hibernate' by power button

2007-02-16 Thread Mick
Hi All,

A few weeks ago I updated acpi and hibernate and their relevant configuration 
files.  Since then when I press the power button on my laptop nothing 
happens.

Clearly something was changed, intentionally or otherwise, and this feature is 
no longer available to me.  Would you care to point me in the right 
direction - how do I set my power button to run the hibernate script?
-- 
Regards,
Mick


pgpBkioO8OntI.pgp
Description: PGP signature


Re: [gentoo-user] 'Hibernate' by power button

2007-02-16 Thread Raymond Lewis Rebbeck
On Saturday, 17 February 2007 5:31, Mick wrote:
 Hi All,

 A few weeks ago I updated acpi and hibernate and their relevant
 configuration files.  Since then when I press the power button on my laptop
 nothing happens.

 Clearly something was changed, intentionally or otherwise, and this feature
 is no longer available to me.  Would you care to point me in the right
 direction - how do I set my power button to run the hibernate script?

I assume you're using acpid. Look in /etc/acpi/ there is a default script that 
is run for acpi events, it handles the power button by calling /sbin/init 0. 
Replace the command it runs with hibernate or similar.

-- 
Raymond Lewis Rebbeck
-- 
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] 'Hibernate' by power button

2007-02-16 Thread Mick
On Friday 16 February 2007 19:13, Raymond Lewis Rebbeck wrote:
 On Saturday, 17 February 2007 5:31, Mick wrote:
  Hi All,
 
  A few weeks ago I updated acpi and hibernate and their relevant
  configuration files.  Since then when I press the power button on my
  laptop nothing happens.
 
  Clearly something was changed, intentionally or otherwise, and this
  feature is no longer available to me.  Would you care to point me in the
  right direction - how do I set my power button to run the hibernate
  script?

 I assume you're using acpid. Look in /etc/acpi/ there is a default script
 that is run for acpi events, it handles the power button by calling
 /sbin/init 0. Replace the command it runs with hibernate or similar.

Thanks Raymond, I have this in my /etc/acpi/events/default:
==
event=button[/]power.*
action=/usr/sbin/hibernate
==

but nothing happens or gets logged when I press the power button.  Could this 
be something to do with the /etc/acpi/default.sh file perhaps?  I vaguely 
remember hacking it unashamedly in the mist of time to get the button 
working.
==
#!/bin/sh
# /etc/acpi/default.sh
# Default acpi script that takes an entry for all actions

set $*  

group=${1/\/*/} 
action=${1/*\//}
device=$2   
id=$3   
value=$4

log_unhandled() {
logger ACPI event unhandled: 
$*   }

case $group in
button) 
case $action in
power)  
/sbin/init 0
;;
sleep) 
/usr/sbin/hibernate
;;
thermal_zone)
;; # I don't care, the fan works anyway.

  # if your laptop doesnt turn on/off the display via hardware
  # switch and instead just generates an acpi event, you can force
  # X to turn off the display via dpms.  note you will have to run
  # 'xhost +local:0' so root can access the X DISPLAY.
  #lid)
xset dpms force off
#   ;;

*)  log_unhandled $* ;;
esac
;;

ac_adapter)
case $value in
# Add code here to handle when the system is unplugged
# (maybe change cpu scaling to powersave mode)
#*0)
#   ;;

# Add code here to handle when the system is plugged 
in
# (maybe change cpu scaling to performance mode)
#*1)
#   ;;
*)  log_unhandled $* ;;
esac
==

Can you spot anything out of place?
-- 
Regards,
Mick


pgpwEUebi2V0b.pgp
Description: PGP signature


Re: [gentoo-user] 'Hibernate' by power button

2007-02-16 Thread Raymond Lewis Rebbeck
On Saturday, 17 February 2007 6:08, Mick wrote:
 On Friday 16 February 2007 19:13, Raymond Lewis Rebbeck wrote:
  On Saturday, 17 February 2007 5:31, Mick wrote:
   Hi All,
  
   A few weeks ago I updated acpi and hibernate and their relevant
   configuration files.  Since then when I press the power button on my
   laptop nothing happens.
  
   Clearly something was changed, intentionally or otherwise, and this
   feature is no longer available to me.  Would you care to point me in
   the right direction - how do I set my power button to run the hibernate
   script?
 
  I assume you're using acpid. Look in /etc/acpi/ there is a default script
  that is run for acpi events, it handles the power button by calling
  /sbin/init 0. Replace the command it runs with hibernate or similar.

 Thanks Raymond, I have this in my /etc/acpi/events/default:
 [snip]

 Can you spot anything out of place?

Your configs seem to all be in order.

Are you sure that the acpid init script has been started?

Also try checking your logs while pressing the hibernate button and acpid 
should output what it is doing and what acpi events it is receiving, you can 
view this on vt12.

-- 
Raymond Lewis Rebbeck
-- 
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] 'Hibernate' by power button

2007-02-16 Thread Mick
On Friday 16 February 2007 19:49, Raymond Lewis Rebbeck wrote:
 On Saturday, 17 February 2007 6:08, Mick wrote:

  Can you spot anything out of place?

 Your configs seem to all be in order.

 Are you sure that the acpid init script has been started?

I am sure it is running alright:
==
# rc-update -s -v | grep -i acpid
   acpid |  default
==

 Also try checking your logs while pressing the hibernate button and acpid
 should output what it is doing and what acpi events it is receiving, you
 can view this on vt12.

Thanks.  It seems that my syslog-ng is configured different to yours (I guess 
some more awful hacking to get xconsole to work is to blame for this) and 
nothing relevant to acpid is shown on vt12.  However, tail -f /var/log/acpid 
showed a couple of errors which I fixed - bar the last one which says:

  [Fri Feb 16 20:30:55 2007] BEGIN HANDLER MESSAGES
  /etc/acpi/default.sh: line 57: syntax error: unexpected end of file

The last few of lines of my /etc/acpi/default.sh show this much:
==
ac_adapter)
case $value in
# Add code here to handle when the system is unplugged
# (maybe change cpu scaling to powersave mode)
#*0)
#   ;;

# Add code here to handle when the system is plugged 
in
# (maybe change cpu scaling to performance mode)
#*1)
#   ;;


*)  log_unhandled $* ;;
esac
==

What's your's like?
-- 
Regards,
Mick


pgphWS5W3XlEc.pgp
Description: PGP signature


Re: [gentoo-user] 'Hibernate' by power button

2007-02-16 Thread Raymond Lewis Rebbeck
On Saturday, 17 February 2007 7:06, Mick wrote:
 On Friday 16 February 2007 19:49, Raymond Lewis Rebbeck wrote:
  On Saturday, 17 February 2007 6:08, Mick wrote:
   Can you spot anything out of place?
 
  Your configs seem to all be in order.
 
  Are you sure that the acpid init script has been started?

 I am sure it is running alright:
 ==
 # rc-update -s -v | grep -i acpid
acpid |  default
 ==

  Also try checking your logs while pressing the hibernate button and acpid
  should output what it is doing and what acpi events it is receiving, you
  can view this on vt12.

 Thanks.  It seems that my syslog-ng is configured different to yours (I
 guess some more awful hacking to get xconsole to work is to blame for this)
 and nothing relevant to acpid is shown on vt12.  However, tail -f
 /var/log/acpid showed a couple of errors which I fixed - bar the last one
 which says:

   [Fri Feb 16 20:30:55 2007] BEGIN HANDLER MESSAGES
   /etc/acpi/default.sh: line 57: syntax error: unexpected end of file

 The last few of lines of my /etc/acpi/default.sh show this much:
 ==
 ac_adapter)
 case $value in
 # Add code here to handle when the system is
 unplugged # (maybe change cpu scaling to powersave mode) #*0)
 #   ;;

 # Add code here to handle when the system is
 plugged in
 # (maybe change cpu scaling to performance mode)
 #*1)
 #   ;;


 *)  log_unhandled $* ;;
 esac
 ==

 What's your's like?

I use the default default.sh that comes with acpid. I've only added a couple 
of files to respond to sleep and lid events.

-- 
Raymond Lewis Rebbeck
-- 
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] 'Hibernate' by power button

2007-02-16 Thread Mick
On Friday 16 February 2007 20:45, Raymond Lewis Rebbeck wrote:
 On Saturday, 17 February 2007 7:06, Mick wrote:
  On Friday 16 February 2007 19:49, Raymond Lewis Rebbeck wrote:
   On Saturday, 17 February 2007 6:08, Mick wrote:
Can you spot anything out of place?
  
   Your configs seem to all be in order.
  
   Are you sure that the acpid init script has been started?
 
  I am sure it is running alright:
  ==
  # rc-update -s -v | grep -i acpid
 acpid |  default
  ==
 
   Also try checking your logs while pressing the hibernate button and
   acpid should output what it is doing and what acpi events it is
   receiving, you can view this on vt12.
 
  Thanks.  It seems that my syslog-ng is configured different to yours (I
  guess some more awful hacking to get xconsole to work is to blame for
  this) and nothing relevant to acpid is shown on vt12.  However, tail -f
  /var/log/acpid showed a couple of errors which I fixed - bar the last one
  which says:
 
[Fri Feb 16 20:30:55 2007] BEGIN HANDLER MESSAGES
/etc/acpi/default.sh: line 57: syntax error: unexpected end of file
 
  The last few of lines of my /etc/acpi/default.sh show this much:
  ==
  ac_adapter)
  case $value in
  # Add code here to handle when the system is
  unplugged # (maybe change cpu scaling to powersave mode) #*0)
  #   ;;
 
  # Add code here to handle when the system is
  plugged in
  # (maybe change cpu scaling to performance mode)
  #*1)
  #   ;;
 
 
  *)  log_unhandled $* ;;
  esac
  ==
 
  What's your's like?

 I use the default default.sh that comes with acpid. I've only added a
 couple of files to respond to sleep and lid events.

Okey, dokey, what do the default last couple of lines/paras look like?

-- 
Regards,
Mick


pgp9JichcwTx0.pgp
Description: PGP signature


Re: [gentoo-user] 'Hibernate' by power button

2007-02-16 Thread Alex Schuster
Mick writes:

   /etc/acpi/default.sh: line 57: syntax error: unexpected end of file
 The last few of lines of my /etc/acpi/default.sh show this much:
 ==
 ac_adapter)
 case $value in
 # Add code here to handle when the system is...
 #   ;;

 # Add code here to handle when the system is...
 # (maybe change cpu scaling to performance mode)
 #*1)
 #   ;;

The inner case statement is not closed by an esac. This is missing (yes, 
log_unhandled comes twice):

  *)  log_unhandled $* ;;
  esac
  ;;

 *)  log_unhandled $* ;;
 esac

emerge -1 acpid should also give you the defaut back. Do a quickpkg 
acpid before if you changed othr things for yourself you want to keep 
(this creates a binary package), you can then emerge it again later 
with emerge -1K acpid.

Alex
-- 
gentoo-user@gentoo.org mailing list