/root/Startup/acpi

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

/root/Startup/acpi

Karl Godt
Administrator
This post was updated on .
What's up with that nugly piece of code ?


Here's /etc/init.d/XX_acpi :
#!/bin/ash
# Karl Godt Dec. 2013 for Puppy Linux Slacko
#set -x


check_for_acpid(){
test "`which acpid`" || { echo "Please install acpid package.";exit 1; }
[ -d /proc/acpi ] ||    { echo "No /proc/acpi . Exiting.";exit 1; }
 [ -d /etc/acpi ] ||    { echo "Please install acpi scripts package.";exit 1; }
test "`busybox modprobe -l | grep -qw button`" && {
[ "`lsmod | grep '^button'`" ] || { echo "Required button.ko kernel module not loaded.";exit 1; }
	}
}

start_acpid(){
acpid -l
sleep 2s
PIDOF_ACPID=`pidof acpid`
test -f /var/run/acpid.pid && read ACPID_PID </var/run/acpid.pid
test "$PIDOF_ACPID" && echo "Started acpid with pid '$PIDOF_ACPID' ."
test "$PIDOF_ACPID" = "$ACPID_PID" || echo "Warning: '$PIDOF_ACPID' is not same as in /var/run/acpid.pid ."	
#acpi_listen &
}	

stop_acpid(){
 test "`pidof acpid`" && { 
 killall acpid && echo "Stopped acpid." || echo "Failed to stop acpid."
 } || echo "acpid is not running."
 test "`pidof acpi_listen`" && { 
 killall acpi_listen && echo "Stopped acpid_listen." || echo "Failed to stop acpid_listen."
 } || echo "acpid_listen is not running."
}

case $1 in 
start|run|up|on)
	check_for_acpid
	test "$DISPLAY" || export DISPLAY=':0'
	start_acpid
;;
stop|kill|down|off)
	stop_acpid
;;
restart|reload|rerun)
	stop_acpid
	sleep 2s
	check_for_acpid
	test "$DISPLAY" || export DISPLAY=':0'
	start_acpid
;;
*)
	echo "$0: Unhandled option '$1' ."
echo "Use 'start|run|up|on' || 'stop|kill|down|off' || 'restart|reload|rerun' ."
	exit 1
;;
esac
exit $?

And /etc/acpi/actions/acpi_poweroff.sh probly needs
test "$DISPLAY" || export DISPLAY=':0' 
before at least launching dialog GUI .

..
acpid exiting
as last message while poweroff was irritating me much .
Reply | Threaded
Open this post in threaded view
|

Re: /root/Startup/acpi

01micko
Administrator
This post was updated on .
I like it Karl, do a pull request. (can't see below).
Reply | Threaded
Open this post in threaded view
|

Re: /root/Startup/acpi

01micko
Administrator
You have noticed my quest to kill of /root/Startup?

Every one we can shift out of there will be for the better.

I think the touchpad thing can be started from a .desktop file, numlockx too (that will require some adjustments to /usr/sbin/quicksetup), xbindkeys, anything really. We'll leave the dir there though because why cause headaches for noobs when they whine about their app not starting?

There is one in there for frisbee, put there by rerwin, network_tray_modeset. I don't think it does anything, just a marker/config file. Weird place for it.

By the way, you can't add it to a pull request because it's not in woof. It's a pet. I'll track it down and upgrade it.
Reply | Threaded
Open this post in threaded view
|

Re: /root/Startup/acpi

Karl Godt
Administrator
Thought that it was a .pet, since I could not find it inside the git folder .
Reply | Threaded
Open this post in threaded view
|

Re: /root/Startup/acpi

Karl Godt
Administrator
# grep acpi /root/.packages/woof-installed-packages 
acpid-2.0.12-3-s|acpid|2.0.12-3-s||BuildingBlock|100K||acpid-2.0.12-3-s.pet||acpi deamon with dialog box and lid supend||||

http://distro.ibiblio.org/puppylinux/pet_packages-slacko/acpid-2.0.12-3-s.pet