Tiny Core Linux

Tiny Core Extensions => TCE Bugs => Topic started by: jur on December 27, 2009, 02:28:50 AM

Title: acpid is buggy
Post by: jur 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'.
Title: Re: acpid is buggy
Post by: Juanito on December 27, 2009, 12:24:03 PM
OK, let me have a look in a couple of days
Title: Re: acpid is buggy
Post by: jur 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
Title: Re: acpid is buggy
Post by: Juanito on December 28, 2009, 03:35:38 AM
Thanks - scripting was never my strong point...
Title: Re: acpid is buggy
Post by: Juanito 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)
Title: Re: acpid is buggy
Post by: Jason W 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.
Title: Re: acpid is buggy
Post by: Juanito 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