[Pm-utils] [PATCH] make the hooks more verbose

Stefan Seyfried seife at suse.de
Tue Nov 28 12:26:27 PST 2006


Hi,

right now, all the services that are started and stopped are not showing
up in the logfile, because the output is redirected to /dev/null.
Change that.

Also indicate when we are done running the hooks, otherwise i get something
like that:
.....
===== Tue Nov 28 09:45:54 CET 2006: running hook: /etc/pm/hooks/95led =====
===== Tue Nov 28 09:45:54 CET 2006: running hook: /etc/pm/hooks/99Zgrub =====
===== Tue Nov 28 09:45:54 CET 2006: running hook: /etc/pm/hooks/99info =====
Calling INT 0x15 (F000:6AB9)
 EAX is 0x5F40
Calling INT 0x15 (F000:6AB9)
 EAX is 0x5F31
Calling INT 0x10 (C000:0014)
 EAX is 0x5F55
Calling INT 0x10 (C000:0014)
 EAX is 0x5F61
Calling INT 0x10 (C000:0014)
 EAX is 0x5F61
Switching from vt63 to vt1
Calling get_mode
Calling do_post
Calling set_vbe_mode
switching back to vt63
Tue Nov 28 10:13:28 CET 2006: running resume hooks.
....

which even confused me for a short while, because 99info is clearly _not_
calling s2ram :-)


Index: pm/functions
===================================================================
RCS file: /cvs/pm-utils/pm-utils/pm/functions,v
retrieving revision 1.30
diff -u -p -r1.30 functions
--- pm/functions	14 Nov 2006 16:01:30 -0000	1.30
+++ pm/functions	28 Nov 2006 20:23:57 -0000
@@ -99,6 +99,8 @@ run_hooks()
 			fi
 		done
 	fi
+
+	echo "$(date): finished $1 hooks."
 }
 
 get_power_status()
@@ -214,7 +216,7 @@ 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
-		"/etc/init.d/$1" stop >/dev/null 2>&1
+		"/etc/init.d/$1" stop 2>&1
 	fi
 }
 
@@ -222,7 +224,7 @@ restartservice()
 {
 	if [ "x$(eval echo \$${1}_SERVICE_ACTIVATE)" == "xyes" \
 			-a -x "/etc/init.d/$1" ]; then
-		"/etc/init.d/$1" start >/dev/null 2>&1
+		"/etc/init.d/$1" start 2>&1
 	fi
 }
 
-- 
Stefan Seyfried
QA / R&D Team Mobile Devices        |              "Any ideas, John?"
SUSE LINUX Products GmbH, Nürnberg  | "Well, surrounding them's out." 


More information about the Pm-utils mailing list