On Jan 28, 2008 8:00 PM, Michael Biebl <[EMAIL PROTECTED]> wrote:
debug output look like?
> pluto:~# pm-powersave true
> Di 29. Jan 02:58:04 CET 2008: running power hooks.
> ===== Di 29. Jan 02:58:04 CET 2008: running hook:
> /usr/lib/pm-utils/power.d/sched-powersave true =====
> **sched policy powersave ON
> Di 29. Jan 02:58:04 CET 2008: done running power:true hooks.

Patch attached to do the appropriate redirection for pm-powersave.

> Seems to work now, maybe I had tested with a bad intermediate version.

:)  Well, if it comes back I am all ears.

> Michael
>
> --
> Why is it that all of the instruments seeking intelligent life in the
> universe are pointed away from Earth?
>
diff --git a/pm/functions b/pm/functions
index fbf03f8..fe57f9f 100755
--- a/pm/functions
+++ b/pm/functions
@@ -169,11 +169,15 @@ do_suspend_hybrid()
 	return 1
 }
 
+init_logfile() {
+	if [ -n "$1" ]; then
+		exec > "$1" 2>&1
+	fi
+}
+
 pm_main()
 {
-	if [ -n "$PM_LOGFILE" ]; then
-		exec > "$PM_LOGFILE" 2>&1
-	fi
+	init_logfile "$PM_LOGFILE" 
 	take_suspend_lock || exit 1
 
 	# make sure that our locks are unlocked no matter how the script exits
diff --git a/src/pm-powersave b/src/pm-powersave
index 84acbaf..11ec1b9 100755
--- a/src/pm-powersave
+++ b/src/pm-powersave
@@ -24,10 +24,12 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #
 
+POWERSAVE_LOGFILE="/dev/null"
 [ -f /usr/lib/pm-utils/functions ] || return 1
 . /usr/lib/pm-utils/functions
 
 if [ "x$1" = "xtrue" -o "x$1" = "xfalse" ] ; then
+    init_logfile "${POWERSAVE_LOGFILE}"
     run_hooks power "$1"
 else
     echo "Argument needs to be true or false" >&2
_______________________________________________
Pm-utils mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/pm-utils

Reply via email to