Hi Gijs

> After which closing the lid at this laptop does *not* result in suspend
> 
> now copying over policy-funcs from acpi-support-base 0.141-2 into
> /usr/share/acpi-support/policy-funcs
> followed by
> 
>   /etc/init.d/acpi-support restart
> 
> *does* result in suspend being called when closing the lid

That seems to be a different problem. The only change between these two
policy-funcs files is the check for systemd-logind (see attached).

Could it be that you have systemd running and thus this feature is not supposed
to be offered by acpi-support but by systemd?

Michael
-- 
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org
Jabber: michael.meskes at gmail dot com
VfL Borussia! Força Barça! Go SF 49ers! Use Debian GNU/Linux, PostgreSQL
--- lib/policy-funcs	2014-07-01 11:50:56.737781399 +0200
+++ ../policy-funcs	2014-07-01 11:50:42.293810770 +0200
@@ -14,13 +14,14 @@
 	local PMS
 
 	getXconsole
-	PMS="/usr/bin/gnome-power-manager /usr/bin/kpowersave /usr/bin/xfce4-power-manager"
+	PMS="/usr/bin/gnome-power-manager /usr/bin/kpowersave /usr/bin/xfce4-power-manager /usr/bin/mate-power-manager"
 	PMS="$PMS /usr/bin/guidance-power-manager /usr/lib/dalston/dalston-power-applet"
 	pidof -x $PMS > /dev/null ||
         { test "$XUSER" != "" && 
           pidof dcopserver > /dev/null &&
           test -x /usr/bin/dcop &&
           /usr/bin/dcop --user $XUSER kded kded loadedModules | grep -q klaptopdaemon; } ||
+        HasLogindAndSystemd1Manager ||
         PowerDevilRunning ||
 	GnomeSettingsDaemonPowerRunning
 }
@@ -48,6 +49,18 @@
 	done
 }
 
+# Check if systemd-logind will be able to call org.freedesktop.systemd1.Manager
+# interface provided by systemd running as PID 1 or by systemd-shim
+HasLogindAndSystemd1Manager() {
+  pidof -x "/lib/systemd/systemd-logind" > /dev/null &&
+  # shutdown.target used as a representative of power management calls class
+  dbus-send --print-reply --system --type=method_call \
+    --dest=org.freedesktop.systemd1 \
+    /org/freedesktop/systemd1 \
+    org.freedesktop.systemd1.Manager.GetUnitFileState string:shutdown.target \
+    > /dev/null 2>&1
+}
+
 # Ask kde if the powerdevil module is loaded
 PowerDevilRunning() {
 	DBusSend kded4 org.kde.kded /kded org.kde.kded.loadedModules | grep -q powerdevil

Reply via email to