WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: acpid is buggy  (Read 2710 times)

Offline jur

  • Hero Member
  • *****
  • Posts: 863
    • cycling photo essays
acpid is buggy
« on: December 27, 2009, 02:28:50 AM »
There are several issues:

1. '/usr/local/etc/init.d/acpid start' does not work when called from bootlocal.sh. Instead, I get startup messages that 1 rule is loaded, and that event logging is off. Why I don't know. If I stop and start acpid manually afterwards, it works just fine. Also, calling acpid from .xsession also works. But not from bootlocal.sh.

2. doing 'acpid restart' terminates but does not restart acpid. Doing 'acpid status' after restart reports 'acpid is not running'.

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14790
Re: acpid is buggy
« Reply #1 on: December 27, 2009, 12:24:03 PM »
OK, let me have a look in a couple of days

Offline jur

  • Hero Member
  • *****
  • Posts: 863
    • cycling photo essays
Re: acpid is buggy
« Reply #2 on: December 27, 2009, 05:27:43 PM »
Item 2 is a code execution issue - the stop function calls killall which terminates the function, so nothing else is executed afterwards:
Code: [Select]
tc@box:~$ sudo /usr/local/etc/init.d/acpid stop
Terminated
tc@box:~$ sudo /usr/local/etc/init.d/acpid restart
Terminated

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14790
Re: acpid is buggy
« Reply #3 on: December 28, 2009, 03:35:38 AM »
Thanks - scripting was never my strong point...

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14790
Re: acpid is buggy
« Reply #4 on: January 08, 2010, 03:20:45 AM »
I've tried the following to stop the daemon:
Code: [Select]
stop() {
killall acpid 2>/dev/null
}
..which works with the bluetooth and cups daemons, but for some reason with acpid, it will stop the daemon, but restart will not work.

I've searched various distros implementations of ../init.d/acpid, but didn't find any usuable alternatives for tc.

Ideas welcome

(note that acpi-2.0.0 shows the same behaviour)

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: acpid is buggy
« Reply #5 on: January 08, 2010, 06:10:09 AM »
Using start-stop-daemon seems to stop it while allowing it to run again:


stop() {
   start-stop-daemon --stop --exec /usr/local/sbin/acpid 2>/dev/null
}

Start-stop-daemon is what I usually use and it normally works well.

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14790
Re: acpid is buggy
« Reply #6 on: January 08, 2010, 10:01:18 AM »
doh...

I'd seen "start-stop-daemon" plenty of times in examples, assumed it wasn't present in the base, but never actually checked  :-[

thanks

edit: updated acpid posted
« Last Edit: January 08, 2010, 10:40:58 AM by Juanito »