[Pm-utils] Re: s2both

Stefan Seyfried seife at suse.de
Wed Mar 14 00:16:32 PDT 2007


On Tue, Mar 13, 2007 at 10:29:43AM -0400, Peter Jones wrote:
> On Mon, 2007-03-12 at 18:10 -0400, David Zeuthen wrote:
> 
> >  1. Can we get a pm-is-supported function?
> 
> Done, in 0.99.2 at http://people.freedesktop.org/~pjones/pm-utils/

> Well, if you give me some feedback about this test release, I don't see
> any reason we can't do it this week.

- it still has 60sysfont and 65alsa, it even grew a third leg with 55battery
- pm-reset-swap is still dangerously broken
- you cannot stopservice / restartservice services with a "-" in their name
  (patch attached)
- 20video and 99video belong into s2ram ;-) but at least into one single
  hook, not two.
- the wrapper for "service" vs "/etc/init.d" should be applied

Patches for all of the above have been posted, most of them multiple times,
on the pm-utils list.

Index: pm/functions
===================================================================
RCS file: /cvs/pm-utils/pm-utils/pm/functions,v
retrieving revision 1.37
diff -u -p -r1.37 functions
--- pm/functions	13 Mar 2007 14:05:51 -0000	1.37
+++ pm/functions	14 Mar 2007 07:14:19 -0000
@@ -231,14 +231,16 @@ stopservice()
 {
 	service "$1" status 2>/dev/null | grep -c -q running
 	if [ "$?" == "0" -a -x "/etc/init.d/$1" ]; then
-		echo "export ${1}_SERVICE_ACTIVATE=yes" >> /var/run/pm-suspend
+		FOO=${1//[-.]/_}
+		echo "export ${FOO}_SERVICE_ACTIVATE=yes" >> /var/run/pm-suspend
 		"/etc/init.d/$1" stop 2>&1
 	fi
 }
 
 restartservice()
 {
-	if [ "x$(eval echo \$${1}_SERVICE_ACTIVATE)" == "xyes" \
+	FOO=${1//[-.]/_}
+	if [ "x$(eval echo \$${FOO}_SERVICE_ACTIVATE)" == "xyes" \
 			-a -x "/etc/init.d/$1" ]; then
 		"/etc/init.d/$1" start 2>&1
 	fi

-- 
Stefan Seyfried

"Any ideas, John?"
"Well, surrounding them's out." 


More information about the Pm-utils mailing list