[28298] in Source-Commits
cluster-login-config commit: Cleanup pkla code and support logind
daemon@ATHENA.MIT.EDU (Jonathan D Reed)
Sat Jul 5 13:01:27 2014
Date: Sat, 5 Jul 2014 13:01:19 -0400
From: Jonathan D Reed <jdreed@MIT.EDU>
Message-Id: <201407051701.s65H1JgY014537@drugstore.mit.edu>
To: source-commits@MIT.EDU
https://github.com/mit-athena/cluster-login-config/commit/862ab1256332f7fefa59a17c42bdf9d2591c9fd2
commit 862ab1256332f7fefa59a17c42bdf9d2591c9fd2
Author: Jonathan Reed <jdreed@mit.edu>
Date: Tue Jul 1 12:49:12 2014 -0400
Cleanup pkla code and support logind
In Trusty, the policies for suspend and hibernate have moved from
upower to logind. So we add groups to the pkla files to disable
those logind actions. Note that logind differentiates between
actions for seats that support single sessions vs multi sessions,
and all Unity sessions are multi-user sessions, by definition.
(Because Unity.)
Also, merge the pkla files to a single file in /var/lib/polkit-1,
with a hierarchical name, and add maintscript-helper code in the
maintscripts to punt the old etc conffiles on upgrade.
debian/changelog | 9 +++++
debian/debathena-cluster-login-config.install | 3 +-
debian/debathena-cluster-login-config.postinst | 4 ++
debian/debathena-cluster-login-config.postrm | 4 ++
debian/debathena-cluster-login-config.preinst | 4 ++
debian/debathena-cluster-login-config.prerm | 4 ++
debian/disable-hibernate.pkla | 5 ---
debian/disable-suspend.pkla | 5 ---
debian/edu.mit.debathena-cluster.pkla | 45 ++++++++++++++++++++++++
9 files changed, 71 insertions(+), 12 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 82be7c9..00cd16a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+debathena-cluster-login-config (1.42) UNRELEASED; urgency=low
+
+ * Combine the two pkla files to disable suspend and hibernate into a
+ single file, which is now correctly located in /var/lib/polkit-1
+ * Add groups to the pkla files to support disabling suspend and
+ hibernate via logind (upower is now deprecated)
+
+ -- Jonathan Reed <jdreed@mit.edu> Tue, 01 Jul 2014 12:48:06 -0400
+
debathena-cluster-login-config (1.41) unstable; urgency=low
* Update getty.debathena to work with logind (which has replaced
diff --git a/debian/debathena-cluster-login-config.install b/debian/debathena-cluster-login-config.install
index 9cea4ad..025d3e7 100644
--- a/debian/debathena-cluster-login-config.install
+++ b/debian/debathena-cluster-login-config.install
@@ -2,8 +2,7 @@ debian/athena-root-password usr/sbin
debian/sshd_not_to_be_run etc/ssh
debian/getty.debathena sbin
debian/screensaver_logout.sh usr/share/debathena-cluster-login-config
-debian/disable-suspend.pkla etc/polkit-1/localauthority/30-site.d
-debian/disable-hibernate.pkla etc/polkit-1/localauthority/30-site.d
+debian/edu.mit.debathena-cluster.pkla var/lib/polkit-1/localauthority/30-site.d
debian/50_debathena-cluster etc/grub.d
debian/debathena-cluster-login-config-sudoers etc/sudoers.d
debian/10-cluster-login-config etc/dconf/db/athena.d
diff --git a/debian/debathena-cluster-login-config.postinst b/debian/debathena-cluster-login-config.postinst
index 0300a6d..e8fe5fd 100644
--- a/debian/debathena-cluster-login-config.postinst
+++ b/debian/debathena-cluster-login-config.postinst
@@ -20,6 +20,10 @@ set -e
#DEBHELPER#
+# We moved this to a single file in /var/lib/polkit-1
+dpkg-maintscript-helper rm_conffile /etc/polkit-1/localauthority/30-site.d/disable-hibernate.pkla 1.41 -- "$@"
+dpkg-maintscript-helper rm_conffile /etc/polkit-1/localauthority/30-site.d/disable-suspend.pkla 1.41 -- "$@"
+
# Clean up from old conffiles
dpkg-maintscript-helper rm_conffile /etc/event.d/ttymsg 1.23 -- "$@"
dpkg-maintscript-helper rm_conffile /etc/init/ttymsg.conf 1.23 -- "$@"
diff --git a/debian/debathena-cluster-login-config.postrm b/debian/debathena-cluster-login-config.postrm
index ca0f348..f6fb3a2 100644
--- a/debian/debathena-cluster-login-config.postrm
+++ b/debian/debathena-cluster-login-config.postrm
@@ -18,6 +18,10 @@ set -e
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
+# We moved this to a single file in /var/lib/polkit-1
+dpkg-maintscript-helper rm_conffile /etc/polkit-1/localauthority/30-site.d/disable-hibernate.pkla 1.41 -- "$@"
+dpkg-maintscript-helper rm_conffile /etc/polkit-1/localauthority/30-site.d/disable-suspend.pkla 1.41 -- "$@"
+
# Clean up from old conffiles
dpkg-maintscript-helper rm_conffile /etc/event.d/ttymsg 1.23 -- "$@"
dpkg-maintscript-helper rm_conffile /etc/init/ttymsg.conf 1.23 -- "$@"
diff --git a/debian/debathena-cluster-login-config.preinst b/debian/debathena-cluster-login-config.preinst
index e865fbc..de49273 100644
--- a/debian/debathena-cluster-login-config.preinst
+++ b/debian/debathena-cluster-login-config.preinst
@@ -13,6 +13,10 @@ set -e
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
+# We moved this to a single file in /var/lib/polkit-1
+dpkg-maintscript-helper rm_conffile /etc/polkit-1/localauthority/30-site.d/disable-hibernate.pkla 1.41 -- "$@"
+dpkg-maintscript-helper rm_conffile /etc/polkit-1/localauthority/30-site.d/disable-suspend.pkla 1.41 -- "$@"
+
# Clean up from old conffiles
dpkg-maintscript-helper rm_conffile /etc/event.d/ttymsg 1.23 -- "$@"
dpkg-maintscript-helper rm_conffile /etc/init/ttymsg.conf 1.23 -- "$@"
diff --git a/debian/debathena-cluster-login-config.prerm b/debian/debathena-cluster-login-config.prerm
index e663eb2..3d45c52 100755
--- a/debian/debathena-cluster-login-config.prerm
+++ b/debian/debathena-cluster-login-config.prerm
@@ -21,6 +21,10 @@ set -e
#DEBHELPER#
+# We moved this to a single file in /var/lib/polkit-1
+dpkg-maintscript-helper rm_conffile /etc/polkit-1/localauthority/30-site.d/disable-hibernate.pkla 1.41 -- "$@"
+dpkg-maintscript-helper rm_conffile /etc/polkit-1/localauthority/30-site.d/disable-suspend.pkla 1.41 -- "$@"
+
# Clean up from old conffiles
dpkg-maintscript-helper rm_conffile /etc/event.d/ttymsg 1.23 -- "$@"
dpkg-maintscript-helper rm_conffile /etc/init/ttymsg.conf 1.23 -- "$@"
diff --git a/debian/disable-hibernate.pkla b/debian/disable-hibernate.pkla
deleted file mode 100644
index 322ea04..0000000
--- a/debian/disable-hibernate.pkla
+++ /dev/null
@@ -1,5 +0,0 @@
-[Disable hibernate]
-Identity=unix-user:*
-Action=org.freedesktop.upower.hibernate
-ResultActive=no
-ResultAny=no
diff --git a/debian/disable-suspend.pkla b/debian/disable-suspend.pkla
deleted file mode 100644
index 5cac314..0000000
--- a/debian/disable-suspend.pkla
+++ /dev/null
@@ -1,5 +0,0 @@
-[Disable suspend]
-Identity=unix-user:*
-Action=org.freedesktop.upower.suspend
-ResultActive=no
-ResultAny=no
diff --git a/debian/edu.mit.debathena-cluster.pkla b/debian/edu.mit.debathena-cluster.pkla
new file mode 100644
index 0000000..ecfcf26
--- /dev/null
+++ b/debian/edu.mit.debathena-cluster.pkla
@@ -0,0 +1,45 @@
+# Disable hibernate via upower (legacy)
+[Disable hibernate]
+Identity=unix-user:*
+Action=org.freedesktop.upower.hibernate
+ResultActive=no
+ResultAny=no
+
+# Disable hibernate via logind
+[Disable hibernate via logind]
+Identity=unix-user:*
+Action=org.freedesktop.login1.hibernate
+ResultActive=no
+ResultAny=no
+
+# Disable hiberate via logind for multiple-session seats
+# which includes any Unity session
+[Disable multi hibernate via logind]
+Identity=unix-user:*
+Action=org.freedesktop.login1.hibernate-multiple-sessions
+ResultActive=no
+ResultAny=no
+
+# Disable suspend via upower (legacy)
+[Disable suspend]
+Identity=unix-user:*
+Action=org.freedesktop.upower.suspend
+ResultActive=no
+ResultAny=no
+
+# Disable suspend via logind for multiple-session seats
+# which includes any Unity session
+# Disable suspend via logind
+[Disable suspend via logind]
+Identity=unix-user:*
+Action=org.freedesktop.login1.suspend
+ResultActive=no
+ResultAny=no
+
+# Disable suspend via logind for multiple-session seats
+# which includes any Unity session
+[Disable multi suspend via logind]
+Identity=unix-user:*
+Action=org.freedesktop.login1.suspend-multiple-sessions
+ResultActive=no
+ResultAny=no