rpms/acpid/F-10 acpid.power.sh, NONE, 1.1 acpid.init, 1.10, 1.11 acpid.spec, 1.31, 1.32 sources, 1.7, 1.8

Zdenek Prikryl zprikryl at fedoraproject.org
Tue Nov 11 13:53:52 UTC 2008


Author: zprikryl

Update of /cvs/extras/rpms/acpid/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv32170

Modified Files:
	acpid.init acpid.spec sources 
Added Files:
	acpid.power.sh 
Log Message:
power.sh works with ConsoleKit >= 0.3.0 (#470752)
Fixed conditions in power.sh, which look for power-managers (#470752)
Added check to init script



--- NEW FILE acpid.power.sh ---
#!/bin/sh

PATH=/sbin:/bin:/usr/bin

# Get the ID of the first active X11 session:
uid_session=$(
ck-list-sessions | \
awk '
/^Session[0-9]+:$/ { uid = active = x11 = "" ; next }
{ gsub(/'\''/, "", $3) }
$1 == "unix-user" { uid = $3 }
$1 == "active" { active = $3 }
$1 == "x11-display" { x11 = $3 }
active == "TRUE" && x11 != "" {
	print uid
	exit
}')

# Check that there is a power manager, otherwise shut down.
[ "$uid_session" ] &&
ps axo uid,cmd | \
awk '
    $1 == '$uid_session' &&
	($2 ~ /gnome-power-manager/ || $2 ~ /kpowersave/) \
		{ found = 1; exit }
    END { exit !found }
' ||
  shutdown -h now



Index: acpid.init
===================================================================
RCS file: /cvs/extras/rpms/acpid/F-10/acpid.init,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- acpid.init	17 Apr 2008 18:58:13 -0000	1.10
+++ acpid.init	11 Nov 2008 13:53:22 -0000	1.11
@@ -27,12 +27,17 @@
 # See how we were called.
 #
 
-start() {
+check() {
 	# Check that we're a privileged user
 	[ `id -u` = 0 ] || exit 4
 	
 	# Check if acpid is executable
 	test -x /usr/sbin/acpid || exit 5
+}
+
+start() {
+
+	check
 	
 	# Check for kernel support
 	[ -f /proc/acpi/event ] || exit 1
@@ -49,6 +54,9 @@
 }
 
 stop() {
+
+	check
+	
 	echo -n $"Stopping acpi daemon: "
 	killproc /usr/sbin/acpid
 	RETVAL=$?
@@ -64,6 +72,9 @@
 }	
 
 reload() {
+	
+	check
+
 	trap "" SIGHUP
 	action $"Reloading acpi daemon:" killall -HUP acpid
 	RETVAL=$?


Index: acpid.spec
===================================================================
RCS file: /cvs/extras/rpms/acpid/F-10/acpid.spec,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- acpid.spec	14 Jul 2008 17:11:19 -0000	1.31
+++ acpid.spec	11 Nov 2008 13:53:22 -0000	1.32
@@ -1,7 +1,7 @@
 Summary: ACPI Event Daemon
 Name: acpid
 Version: 1.0.6
-Release: 8%{?dist}
+Release: 9%{?dist}
 License: GPLv2+
 Group: System Environment/Daemons
 Source: http://prdownloads.sourceforge.net/acpid/acpid-%{version}.tar.gz
@@ -87,6 +87,11 @@
 fi
 
 %changelog
+* Tue Nov 11 2008 Zdenek Prikryl <zprikryl at redhat.com> - 1.0.6-9
+- power.sh works with ConsoleKit >= 0.3.0 (#470752)
+- Fixed conditions in power.sh, which look for power-managers (#470752)
+- Added check to init script
+
 * Mon Jul 14 2008 Tom "spot" Callaway <tcallawa at redhat.com> - 1.0.6-8
 - fix license tag
 


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/acpid/F-10/sources,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- sources	23 Jan 2008 14:04:21 -0000	1.7
+++ sources	11 Nov 2008 13:53:22 -0000	1.8
@@ -1,2 +1 @@
 5c9b705700df51d232be223b6ab6414d  acpid-1.0.6.tar.gz
-581b7998a78b140ca58c428338c734ed  acpid.power.sh




More information about the fedora-extras-commits mailing list