diff --git a/srcpkgs/ConsoleKit/files/90-consolekit-3 b/srcpkgs/ConsoleKit/files/90-consolekit-3 deleted file mode 100644 index 358fc24f1a..0000000000 --- a/srcpkgs/ConsoleKit/files/90-consolekit-3 +++ /dev/null @@ -1,32 +0,0 @@ -# -*- sh -*- -# Xsession.d script for ck-launch-session. -# -# -# This file is sourced by Xsession(5), not executed. - -CK_LAUNCH_SESSION=/usr/bin/ck-launch-session - -is_on_console() { - session=$(dbus-send --system --dest=org.freedesktop.ConsoleKit \ - --type=method_call --print-reply --reply-timeout=2000 \ - /org/freedesktop/ConsoleKit/Manager \ - org.freedesktop.ConsoleKit.Manager.GetCurrentSession \ - | grep path | awk '{print $3}' | sed s/\"//g) - x11_display=$(dbus-send --system --dest=org.freedesktop.ConsoleKit \ - --type=method_call --print-reply --reply-timeout=2000 \ - $session org.freedesktop.ConsoleKit.Session.GetX11Display \ - | grep string | awk '{print $2}' | sed s/\"//g) - - if [ -z "$x11_display" ] ; then - return 0 - else - return 1 - fi -} - -# gdm already creates a CK session for us, so do not run the expensive D-Bus -# calls if we have $GDMSESSION -if [ -z "$GDMSESSION" ] && [ -x "$CK_LAUNCH_SESSION" ] && \ - ( [ -z "$XDG_SESSION_COOKIE" ] || is_on_console ) ; then - command="$CK_LAUNCH_SESSION $command" -fi diff --git a/srcpkgs/ConsoleKit/files/pam-foreground-compat.ck b/srcpkgs/ConsoleKit/files/pam-foreground-compat.ck deleted file mode 100755 index 7f6b122d5f..0000000000 --- a/srcpkgs/ConsoleKit/files/pam-foreground-compat.ck +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -TAGDIR=/var/run/console - -[ -n "$CK_SESSION_USER_UID" ] || exit 1 - -TAGFILE="$TAGDIR/`getent passwd $CK_SESSION_USER_UID | cut -f 1 -d:`" - -if [ "$1" = "session_added" ]; then - mkdir -p "$TAGDIR" - echo "$CK_SESSION_ID" >> "$TAGFILE" -fi - -if [ "$1" = "session_removed" ] && [ -e "$TAGFILE" ]; then - sed -i "\%^$CK_SESSION_ID\$%d" "$TAGFILE" - [ -s "$TAGFILE" ] || rm -f "$TAGFILE" -fi diff --git a/srcpkgs/ConsoleKit2/patches/0001-Fix-installing-logrotate-file.patch b/srcpkgs/ConsoleKit2/patches/0001-Fix-installing-logrotate-file.patch new file mode 100644 index 0000000000..dcac4883e0 --- /dev/null +++ b/srcpkgs/ConsoleKit2/patches/0001-Fix-installing-logrotate-file.patch @@ -0,0 +1,140 @@ +From cfea98feebc9b1668d555d98481698dc4eefe532 Mon Sep 17 00:00:00 2001 +From: Eric Koegel +Date: Tue, 11 Nov 2014 19:20:43 +0300 +Subject: [PATCH 01/12] Fix installing logrotate file + +This ensures the logrotate file will rotate the history file correctly. +It also now installs to the right location. +--- + .gitignore | 1 + + configure.ac | 13 ------------- + data/Makefile.am | 34 +++++++++++++++++++++++++++++----- + data/consolekit.logrotate | 8 -------- + data/consolekit.logrotate.in | 8 ++++++++ + 5 files changed, 38 insertions(+), 26 deletions(-) + delete mode 100644 data/consolekit.logrotate + create mode 100644 data/consolekit.logrotate.in + +diff --git a/configure.ac b/configure.ac +index 8516c53..12cb074 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -287,18 +287,6 @@ else + fi + AC_SUBST(PAM_MODULE_DIR) + +-dnl --------------------------------------------------------------------------- +-dnl - Install directory for syslog rotation file +-dnl --------------------------------------------------------------------------- +- +-AC_ARG_WITH(logrotate-dir, +- [AS_HELP_STRING([--with-logrotate-dir=],[directory to install syslog rotation file])]) +-if ! test -z "$with_logrotate_dir"; then +- LOGROTATE_DIR="$with_logrotate_dir" +-else +- LOGROTATE_DIR="/etc/logrotate.d" +-fi +-AC_SUBST(LOGROTATE_DIR) + + dnl --------------------------------------------------------------------------- + dnl - Install directory for xinitrc file +@@ -527,7 +515,6 @@ echo " + Build PAM module: ${msg_pam_module} + Build udev-acl: ${enable_udev_acl} + Build docs: ${enable_docbook_docs} +- Log rotate dir: ${LOGROTATE_DIR} + xinitrc dir: ${XINITRC_DIR} + + PolicyKit support ${have_polkit} +diff --git a/data/Makefile.am b/data/Makefile.am +index 173df0e..38876d5 100644 +--- a/data/Makefile.am ++++ b/data/Makefile.am +@@ -1,12 +1,13 @@ + NULL = + ++BUILT_SOURCES = ++ + dbusconfdir = $(DBUS_SYS_DIR) + dbusconf_DATA = ConsoleKit.conf + + seatdir = $(sysconfdir)/ConsoleKit/seats.d + seat_DATA = 00-primary.seat + +-logdir = $(LOGROTATE_DIR) + xinitrcdir = $(XINITRC_DIR) + + if HAVE_POLKIT +@@ -72,14 +73,35 @@ edit = sed \ + -e 's|@localstatedir[@]|$(localstatedir)|g' \ + -e 's|@CONSOLE_KIT_PID_FILE[@]|$(CONSOLE_KIT_PID_FILE)|g' + +- +-install-log: +- $(INSTALL_PROGRAM) consolekit.logrotate $(logdir) +- + install-xinitrc: + $(INSTALL_PROGRAM) 90-consolekit $(xinitrcdir) && \ + chmod +x $(xinitrcdir)/90-consolekit + ++install-data-local: install-logrotate ++ $(MKDIR_P) $(DESTDIR)$(localstatedir)/log/ConsoleKit/ ++ ++uninstall-local:: uninstall-logrotate ++ rmdir $(DESTDIR)$(localstatedir)/log/ConsoleKit/ ++ ++LOGROTATE_CONFS = consolekit.logrotate ++ ++BUILT_SOURCES += $(LOGROTATE_CONFS) ++ ++consolekit.logrotate: consolekit.logrotate.in ++ sed \ ++ -e 's![@]localstatedir[@]!$(localstatedir)!g' \ ++ < $< > $@-t ++ mv $@-t $@ ++ ++install-logrotate: $(LOGROTATE_CONFS) ++ $(MKDIR_P) $(DESTDIR)$(localstatedir)/log/ConsoleKit/ \ ++ $(DESTDIR)$(sysconfdir)/logrotate.d/ ++ $(INSTALL_DATA) consolekit.logrotate $(DESTDIR)$(sysconfdir)/logrotate.d/consolekit ++ ++ ++uninstall-logrotate: ++ rm -f $(DESTDIR)$(sysconfdir)/logrotate.d/consolekit ++ + EXTRA_DIST = \ + ck-log-system-restart \ + ck-log-system-start \ +@@ -92,6 +114,7 @@ EXTRA_DIST = \ + console-kit-log-system-stop.service.in \ + console-kit-log-system-restart.service.in \ + 90-consolekit \ ++ consolekit.logrotate.in \ + $(NULL) + + MAINTAINERCLEANFILES = \ +@@ -100,6 +123,7 @@ MAINTAINERCLEANFILES = \ + + CLEANFILES = \ + $(service_DATA) \ ++ $(BUILT_SOURCES) \ + console-kit-daemon.service \ + console-kit-log-system-start.service \ + console-kit-log-system-stop.service \ +diff --git a/data/consolekit.logrotate.in b/data/consolekit.logrotate.in +new file mode 100644 +index 0000000..656b312 +--- /dev/null ++++ b/data/consolekit.logrotate.in +@@ -0,0 +1,8 @@ ++@localstatedir@/log/ConsoleKit/history { ++ monthly ++ rotate 6 ++ delaycompress ++ compress ++ notifempty ++ missingok ++} +-- +2.2.1 + diff --git a/srcpkgs/ConsoleKit2/patches/0002-Conditionally-add-the-SystemdService.patch b/srcpkgs/ConsoleKit2/patches/0002-Conditionally-add-the-SystemdService.patch new file mode 100644 index 0000000000..524bdc8c13 --- /dev/null +++ b/srcpkgs/ConsoleKit2/patches/0002-Conditionally-add-the-SystemdService.patch @@ -0,0 +1,62 @@ +From 856e442af8f03168b6a8425fcb06bb685c663af8 Mon Sep 17 00:00:00 2001 +From: Eric Koegel +Date: Mon, 10 Nov 2014 11:58:36 +0300 +Subject: [PATCH 02/12] Conditionally add the SystemdService + +Add the SystemdService service tag to the consolekit service file +if we're being built with systemd support. +--- + data/Makefile.am | 17 ++++++++++++----- + data/org.freedesktop.ConsoleKit.service.in | 2 +- + 2 files changed, 13 insertions(+), 6 deletions(-) + +diff --git a/data/Makefile.am b/data/Makefile.am +index 38876d5..acb381f 100644 +--- a/data/Makefile.am ++++ b/data/Makefile.am +@@ -24,6 +24,12 @@ service_DATA = $(service_in_files:.service.in=.service) + $(service_DATA): $(service_in_files) Makefile + $(edit) $< >$@ + ++edit = sed \ ++ -e 's|@sbindir[@]|$(sbindir)|g' \ ++ -e 's|@sysconfdir[@]|$(sysconfdir)|g' \ ++ -e 's|@localstatedir[@]|$(localstatedir)|g' \ ++ -e 's|@CONSOLE_KIT_PID_FILE[@]|$(CONSOLE_KIT_PID_FILE)|g' ++ + if HAVE_SYSTEMD + systemdsystemunit_DATA = \ + console-kit-daemon.service \ +@@ -65,13 +71,14 @@ install-data-hook: + ( cd $(DESTDIR)$(systemdsystemunitdir)/kexec.target.wants && \ + rm -f console-kit-log-system-restart.service && \ + $(LN_S) ../console-kit-log-system-restart.service ) ++ ++edit += \ ++ -e 's|@SystemdService[@]|SystemdService=console-kit-daemon.service|g' ++else ++edit += \ ++ -e 's|@SystemdService[@]||g' + endif + +-edit = sed \ +- -e 's|@sbindir[@]|$(sbindir)|g' \ +- -e 's|@sysconfdir[@]|$(sysconfdir)|g' \ +- -e 's|@localstatedir[@]|$(localstatedir)|g' \ +- -e 's|@CONSOLE_KIT_PID_FILE[@]|$(CONSOLE_KIT_PID_FILE)|g' + + install-xinitrc: + $(INSTALL_PROGRAM) 90-consolekit $(xinitrcdir) && \ +diff --git a/data/org.freedesktop.ConsoleKit.service.in b/data/org.freedesktop.ConsoleKit.service.in +index 5e35ebb..f5f55dc 100644 +--- a/data/org.freedesktop.ConsoleKit.service.in ++++ b/data/org.freedesktop.ConsoleKit.service.in +@@ -2,4 +2,4 @@ + Name=org.freedesktop.ConsoleKit + Exec=@sbindir@/console-kit-daemon --no-daemon + User=root +-SystemdService=console-kit-daemon.service ++@SystemdService@ +-- +2.2.1 + diff --git a/srcpkgs/ConsoleKit2/patches/0003-Fix-installing-90-consolekit-file.patch b/srcpkgs/ConsoleKit2/patches/0003-Fix-installing-90-consolekit-file.patch new file mode 100644 index 0000000000..9d865a5469 --- /dev/null +++ b/srcpkgs/ConsoleKit2/patches/0003-Fix-installing-90-consolekit-file.patch @@ -0,0 +1,187 @@ +From 2c1f7c245a2592b94b8a19d380a77ad1326a7ea4 Mon Sep 17 00:00:00 2001 +From: Eric Koegel +Date: Mon, 10 Nov 2014 15:53:36 +0300 +Subject: [PATCH 03/12] Fix installing 90-consolekit file + +This ensures the 90-consolekit file will be installed to the +right location. +--- + .gitignore | 1 + + configure.ac | 2 +- + data/90-consolekit | 32 -------------------------------- + data/90-consolekit.in | 32 ++++++++++++++++++++++++++++++++ + data/Makefile.am | 31 ++++++++++++++++++++++--------- + 5 files changed, 56 insertions(+), 42 deletions(-) + delete mode 100644 data/90-consolekit + create mode 100644 data/90-consolekit.in + +diff --git a/configure.ac b/configure.ac +index 12cb074..d45a937 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -297,7 +297,7 @@ AC_ARG_WITH(xinitrc-dir, + if ! test -z "$with_xinitrc_dir"; then + XINITRC_DIR="$with_xinitrc_dir" + else +- XINITRC_DIR="/etc/X11/xinit/xinitrc.d" ++ XINITRC_DIR="$sysconfdir/X11/xinit/xinitrc.d" + fi + AC_SUBST(XINITRC_DIR) + +diff --git a/data/90-consolekit b/data/90-consolekit +deleted file mode 100644 +index f0082a7..0000000 +--- a/data/90-consolekit ++++ /dev/null +@@ -1,32 +0,0 @@ +-# -*- sh -*- +-# Xsession.d script for ck-launch-session. +-# +-# +-# This file is sourced by Xsession(5), not executed. +- +-CK_LAUNCH_SESSION=/usr/bin/ck-launch-session +- +-is_on_console() { +- session=$(dbus-send --system --dest=org.freedesktop.ConsoleKit \ +- --type=method_call --print-reply --reply-timeout=2000 \ +- /org/freedesktop/ConsoleKit/Manager \ +- org.freedesktop.ConsoleKit.Manager.GetCurrentSession \ +- | grep path | awk '{print $3}' | sed s/\"//g) +- x11_display=$(dbus-send --system --dest=org.freedesktop.ConsoleKit \ +- --type=method_call --print-reply --reply-timeout=2000 \ +- $session org.freedesktop.ConsoleKit.Session.GetX11Display \ +- | grep string | awk '{print $2}' | sed s/\"//g) +- +- if [ -z "$x11_display" ] ; then +- return 0 +- else +- return 1 +- fi +-} +- +-# gdm already creates a CK session for us, so do not run the expensive D-Bus +-# calls if we have $GDMSESSION +-if [ -z "$GDMSESSION" ] && [ -x "$CK_LAUNCH_SESSION" ] && \ +- ( [ -z "$XDG_SESSION_COOKIE" ] || is_on_console ) ; then +- STARTUP="$CK_LAUNCH_SESSION $STARTUP" +-fi +diff --git a/data/90-consolekit.in b/data/90-consolekit.in +new file mode 100644 +index 0000000..30847b2 +--- /dev/null ++++ b/data/90-consolekit.in +@@ -0,0 +1,32 @@ ++# -*- sh -*- ++# Xsession.d script for ck-launch-session. ++# ++# ++# This file is sourced by Xsession(5), not executed. ++ ++@CK_LAUNCH_SESSION@ ++ ++is_on_console() { ++ session=$(dbus-send --system --dest=org.freedesktop.ConsoleKit \ ++ --type=method_call --print-reply --reply-timeout=2000 \ ++ /org/freedesktop/ConsoleKit/Manager \ ++ org.freedesktop.ConsoleKit.Manager.GetCurrentSession \ ++ | grep path | awk '{print $3}' | sed s/\"//g) ++ x11_display=$(dbus-send --system --dest=org.freedesktop.ConsoleKit \ ++ --type=method_call --print-reply --reply-timeout=2000 \ ++ $session org.freedesktop.ConsoleKit.Session.GetX11Display \ ++ | grep string | awk '{print $2}' | sed s/\"//g) ++ ++ if [ -z "$x11_display" ] ; then ++ return 0 ++ else ++ return 1 ++ fi ++} ++ ++# gdm already creates a CK session for us, so do not run the expensive D-Bus ++# calls if we have $GDMSESSION ++if [ -z "$GDMSESSION" ] && [ -x "$CK_LAUNCH_SESSION" ] && \ ++ ( [ -z "$XDG_SESSION_COOKIE" ] || is_on_console ) ; then ++ STARTUP="$CK_LAUNCH_SESSION $STARTUP" ++fi +diff --git a/data/Makefile.am b/data/Makefile.am +index acb381f..6b47655 100644 +--- a/data/Makefile.am ++++ b/data/Makefile.am +@@ -8,7 +8,6 @@ dbusconf_DATA = ConsoleKit.conf + seatdir = $(sysconfdir)/ConsoleKit/seats.d + seat_DATA = 00-primary.seat + +-xinitrcdir = $(XINITRC_DIR) + + if HAVE_POLKIT + polkit_policydir = $(datadir)/polkit-1/actions +@@ -80,19 +79,20 @@ edit += \ + endif + + +-install-xinitrc: +- $(INSTALL_PROGRAM) 90-consolekit $(xinitrcdir) && \ +- chmod +x $(xinitrcdir)/90-consolekit +- +-install-data-local: install-logrotate ++install-data-local: install-logrotate install-90-consolekit + $(MKDIR_P) $(DESTDIR)$(localstatedir)/log/ConsoleKit/ + +-uninstall-local:: uninstall-logrotate ++uninstall-local:: uninstall-logrotate uninstall-90-consolekit + rmdir $(DESTDIR)$(localstatedir)/log/ConsoleKit/ + + LOGROTATE_CONFS = consolekit.logrotate + +-BUILT_SOURCES += $(LOGROTATE_CONFS) ++XINITRC_CONFS = 90-consolekit ++ ++BUILT_SOURCES += \ ++ $(LOGROTATE_CONFS) \ ++ $(XINITRC_CONFS) \ ++ $(NULL) + + consolekit.logrotate: consolekit.logrotate.in + sed \ +@@ -100,15 +100,28 @@ consolekit.logrotate: consolekit.logrotate.in + < $< > $@-t + mv $@-t $@ + ++90-consolekit: 90-consolekit.in ++ sed \ ++ -e 's![@]CK_LAUNCH_SESSION[@]!CK_LAUNCH_SESSION=$(bindir)/ck-launch-session!g' \ ++ < $< > $@-t ++ mv $@-t $@ ++ + install-logrotate: $(LOGROTATE_CONFS) + $(MKDIR_P) $(DESTDIR)$(localstatedir)/log/ConsoleKit/ \ + $(DESTDIR)$(sysconfdir)/logrotate.d/ + $(INSTALL_DATA) consolekit.logrotate $(DESTDIR)$(sysconfdir)/logrotate.d/consolekit + ++install-90-consolekit: $(XINITRC_CONFS) ++ $(MKDIR_P) $(DESTDIR)$(XINITRC_DIR)/ ++ $(INSTALL_PROGRAM) 90-consolekit $(DESTDIR)$(XINITRC_DIR) && \ ++ chmod +x $(DESTDIR)$(XINITRC_DIR)/90-consolekit + + uninstall-logrotate: + rm -f $(DESTDIR)$(sysconfdir)/logrotate.d/consolekit + ++uninstall-90-consolekit: ++ rm -f $(DESTDIR)$(XINITRC_DIR)/90-consolekit ++ + EXTRA_DIST = \ + ck-log-system-restart \ + ck-log-system-start \ +@@ -120,7 +133,7 @@ EXTRA_DIST = \ + console-kit-log-system-start.service.in \ + console-kit-log-system-stop.service.in \ + console-kit-log-system-restart.service.in \ +- 90-consolekit \ ++ 90-consolekit.in \ + consolekit.logrotate.in \ + $(NULL) + +-- +2.2.1 + diff --git a/srcpkgs/ConsoleKit2/patches/0004-trivial-ignore-non-empty-log-dir-on-uninstall.patch b/srcpkgs/ConsoleKit2/patches/0004-trivial-ignore-non-empty-log-dir-on-uninstall.patch new file mode 100644 index 0000000000..d0942c1659 --- /dev/null +++ b/srcpkgs/ConsoleKit2/patches/0004-trivial-ignore-non-empty-log-dir-on-uninstall.patch @@ -0,0 +1,25 @@ +From d34e7aabd04018f70b15e54ccfffe93781f97bf6 Mon Sep 17 00:00:00 2001 +From: Eric Koegel +Date: Wed, 12 Nov 2014 19:21:37 +0300 +Subject: [PATCH 04/12] trivial: ignore non-empty log dir on uninstall + +--- + data/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/data/Makefile.am b/data/Makefile.am +index 6b47655..abd9403 100644 +--- a/data/Makefile.am ++++ b/data/Makefile.am +@@ -83,7 +83,7 @@ install-data-local: install-logrotate install-90-consolekit + $(MKDIR_P) $(DESTDIR)$(localstatedir)/log/ConsoleKit/ + + uninstall-local:: uninstall-logrotate uninstall-90-consolekit +- rmdir $(DESTDIR)$(localstatedir)/log/ConsoleKit/ ++ rmdir --ignore-fail-on-non-empty $(DESTDIR)$(localstatedir)/log/ConsoleKit/ + + LOGROTATE_CONFS = consolekit.logrotate + +-- +2.2.1 + diff --git a/srcpkgs/ConsoleKit2/patches/0005-Add-the-PrepareForSleep-Shutdown-signals.patch b/srcpkgs/ConsoleKit2/patches/0005-Add-the-PrepareForSleep-Shutdown-signals.patch new file mode 100644 index 0000000000..8da74582a8 --- /dev/null +++ b/srcpkgs/ConsoleKit2/patches/0005-Add-the-PrepareForSleep-Shutdown-signals.patch @@ -0,0 +1,411 @@ +From cea7cb81dd95b447a8d5cb279307c435d9dc968c Mon Sep 17 00:00:00 2001 +From: Eric Koegel +Date: Mon, 17 Nov 2014 10:16:26 +0300 +Subject: [PATCH 05/12] Add the PrepareForSleep/Shutdown signals + +This patch adds the PrepareForSleep/Shutdown signals so apps can +listed for these signals and perform operations prior to the event +such as logging out of online chatrooms. +--- + po/ConsoleKit2.pot | 14 +- + src/ck-manager.c | 210 +++++++++++++++++++++++++---- + src/ck-manager.h | 4 + + src/org.freedesktop.ConsoleKit.Manager.xml | 31 +++++ + 4 files changed, 224 insertions(+), 35 deletions(-) + +diff --git a/po/ConsoleKit2.pot b/po/ConsoleKit2.pot +index 331b9e2..31f9ec7 100644 +--- a/po/ConsoleKit2.pot ++++ b/po/ConsoleKit2.pot +@@ -8,7 +8,7 @@ msgid "" + msgstr "" + "Project-Id-Version: PACKAGE VERSION\n" + "Report-Msgid-Bugs-To: https://github.com/ConsoleKit2/ConsoleKit2/issues\n" +-"POT-Creation-Date: 2014-11-02 15:43+0300\n" ++"POT-Creation-Date: 2014-11-17 10:15+0300\n" + "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" + "Last-Translator: FULL NAME \n" + "Language-Team: LANGUAGE \n" +@@ -65,29 +65,29 @@ msgstr "" + msgid "No consoles available" + msgstr "" + +-#: src/ck-manager.c:2516 src/ck-manager.c:2615 src/ck-manager.c:2672 ++#: src/ck-manager.c:2648 src/ck-manager.c:2747 src/ck-manager.c:2804 + msgid "Unable to get information about the calling process" + msgstr "" + +-#: src/ck-manager.c:2529 src/ck-session.c:278 ++#: src/ck-manager.c:2661 src/ck-session.c:278 + #, c-format + msgid "Unable to lookup information about calling process '%d'" + msgstr "" + +-#: src/ck-manager.c:2553 src/ck-manager.c:2565 src/ck-manager.c:2822 ++#: src/ck-manager.c:2685 src/ck-manager.c:2697 src/ck-manager.c:2954 + msgid "Unable to find session for cookie" + msgstr "" + +-#: src/ck-manager.c:2629 ++#: src/ck-manager.c:2761 + #, c-format + msgid "Unable to lookup session information for process '%d'" + msgstr "" + +-#: src/ck-manager.c:2830 ++#: src/ck-manager.c:2962 + msgid "User ID does not match the owner of cookie" + msgstr "" + +-#: src/ck-manager.c:2840 ++#: src/ck-manager.c:2972 + msgid "Process ID does not match the owner of cookie" + msgstr "" + +diff --git a/src/ck-manager.c b/src/ck-manager.c +index cf5a40b..0110d89 100644 +--- a/src/ck-manager.c ++++ b/src/ck-manager.c +@@ -83,15 +83,31 @@ struct CkManagerPrivate + gboolean system_idle_hint; + GTimeVal system_idle_since_hint; + ++ /* How long to delay after emitting the PREPARE_FOR_SHUTDOWN or ++ * PREPARE_FOR_SLEEP signal */ ++ guint system_action_idle_delay; ++ + CkInhibitManager *inhibit_manager; + }; + +-enum { ++typedef enum { + SEAT_ADDED, + SEAT_REMOVED, + SYSTEM_IDLE_HINT_CHANGED, ++ PREPARE_FOR_SHUTDOWN, ++ PREPARE_FOR_SLEEP, + LAST_SIGNAL +-}; ++} SIGNALS; ++ ++typedef struct ++{ ++ CkManager *manager; ++ DBusGMethodInvocation *context; ++ const gchar *command; ++ CkLogEventType event_type; ++ const gchar *description; ++ SIGNALS signal; ++} SystemActionData; + + static guint signals [LAST_SIGNAL] = { 0, }; + +@@ -1198,7 +1214,7 @@ do_system_action (CkManager *manager, + g_debug ("command is %s", command); + + error = NULL; +- res = g_spawn_command_line_async (command, &error); ++ res = g_spawn_command_line_sync (command, NULL, NULL, NULL, &error); + + if (! res) { + GError *new_error; +@@ -1218,15 +1234,55 @@ do_system_action (CkManager *manager, + } + } + ++static gboolean ++system_action_idle_cb(SystemActionData *data) ++{ ++ g_return_val_if_fail (data != NULL, FALSE); ++ ++ /* Perform the action */ ++ do_system_action (data->manager, ++ data->context, ++ data->command, ++ data->event_type, ++ data->description); ++ ++ /* If we got here the sleep action is done and we're awake again ++ * or the operation failed. Either way we can signal to the apps */ ++ g_signal_emit (data->manager, signals [data->signal], 0, FALSE); ++ ++ g_free (data); ++ ++ return FALSE; ++} ++ + static void + do_restart (CkManager *manager, + DBusGMethodInvocation *context) + { +- do_system_action (manager, +- context, +- PREFIX "/lib/ConsoleKit/scripts/ck-system-restart", +- CK_LOG_EVENT_SYSTEM_RESTART, +- "Restart"); ++ SystemActionData *data; ++ ++ /* Emit the signal */ ++ g_signal_emit (manager, signals [PREPARE_FOR_SHUTDOWN], 0, TRUE); ++ ++ /* Allocate and fill the data struct to pass to the idle cb */ ++ data = g_new0 (SystemActionData, 1); ++ if (data == NULL) { ++ g_critical ("failed to allocate memory to perform shutdown\n"); ++ g_signal_emit (manager, signals [PREPARE_FOR_SHUTDOWN], 0, FALSE); ++ return; ++ } ++ ++ data->manager = manager; ++ data->context = context; ++ data->command = PREFIX "/lib/ConsoleKit/scripts/ck-system-restart"; ++ data->event_type = CK_LOG_EVENT_SYSTEM_RESTART; ++ data->description = "Restart"; ++ data->signal = PREPARE_FOR_SHUTDOWN; ++ ++ /* Sleep so user applications have time to respond */ ++ g_timeout_add (data->manager->priv->system_action_idle_delay, ++ (GSourceFunc)system_action_idle_cb, ++ data); + } + + /* +@@ -1289,11 +1345,30 @@ static void + do_stop (CkManager *manager, + DBusGMethodInvocation *context) + { +- do_system_action (manager, +- context, +- PREFIX "/lib/ConsoleKit/scripts/ck-system-stop", +- CK_LOG_EVENT_SYSTEM_STOP, +- "Stop"); ++ SystemActionData *data; ++ ++ /* Emit the signal */ ++ g_signal_emit (manager, signals [PREPARE_FOR_SHUTDOWN], 0, TRUE); ++ ++ /* Allocate and fill the data struct to pass to the idle cb */ ++ data = g_new0 (SystemActionData, 1); ++ if (data == NULL) { ++ g_critical ("failed to allocate memory to perform shutdown\n"); ++ g_signal_emit (manager, signals [PREPARE_FOR_SHUTDOWN], 0, FALSE); ++ return; ++ } ++ ++ data->manager = manager; ++ data->context = context; ++ data->command = PREFIX "/lib/ConsoleKit/scripts/ck-system-stop"; ++ data->event_type = CK_LOG_EVENT_SYSTEM_STOP; ++ data->description = "Stop"; ++ data->signal = PREPARE_FOR_SHUTDOWN; ++ ++ /* Sleep so user applications have time to respond */ ++ g_timeout_add (data->manager->priv->system_action_idle_delay, ++ (GSourceFunc)system_action_idle_cb, ++ data); + } + + gboolean +@@ -1486,11 +1561,30 @@ static void + do_suspend (CkManager *manager, + DBusGMethodInvocation *context) + { +- do_system_action (manager, +- context, +- PREFIX "/lib/ConsoleKit/scripts/ck-system-suspend", +- CK_LOG_EVENT_SYSTEM_SUSPEND, +- "Suspend"); ++ SystemActionData *data; ++ ++ /* Emit the signal */ ++ g_signal_emit (manager, signals [PREPARE_FOR_SLEEP], 0, TRUE); ++ ++ /* Allocate and fill the data struct to pass to the idle cb */ ++ data = g_new0 (SystemActionData, 1); ++ if (data == NULL) { ++ g_critical ("failed to allocate memory to perform suspend\n"); ++ g_signal_emit (manager, signals [PREPARE_FOR_SLEEP], 0, FALSE); ++ return; ++ } ++ ++ data->manager = manager; ++ data->context = context; ++ data->command = PREFIX "/lib/ConsoleKit/scripts/ck-system-suspend"; ++ data->event_type = CK_LOG_EVENT_SYSTEM_SUSPEND; ++ data->description = "Suspend"; ++ data->signal = PREPARE_FOR_SLEEP; ++ ++ /* Sleep so user applications have time to respond */ ++ g_timeout_add (data->manager->priv->system_action_idle_delay, ++ (GSourceFunc)system_action_idle_cb, ++ data); + } + + /* +@@ -1572,11 +1666,30 @@ static void + do_hibernate (CkManager *manager, + DBusGMethodInvocation *context) + { +- do_system_action (manager, +- context, +- PREFIX "/lib/ConsoleKit/scripts/ck-system-hibernate", +- CK_LOG_EVENT_SYSTEM_HIBERNATE, +- "Hibernate"); ++ SystemActionData *data; ++ ++ /* Emit the signal */ ++ g_signal_emit (manager, signals [PREPARE_FOR_SLEEP], 0, TRUE); ++ ++ /* Allocate and fill the data struct to pass to the idle cb */ ++ data = g_new0 (SystemActionData, 1); ++ if (data == NULL) { ++ g_critical ("failed to allocate memory to perform suspend\n"); ++ g_signal_emit (manager, signals [PREPARE_FOR_SLEEP], 0, FALSE); ++ return; ++ } ++ ++ data->manager = manager; ++ data->context = context; ++ data->command = PREFIX "/lib/ConsoleKit/scripts/ck-system-hibernate"; ++ data->event_type = CK_LOG_EVENT_SYSTEM_HIBERNATE; ++ data->description = "Hibernate"; ++ data->signal = PREPARE_FOR_SLEEP; ++ ++ /* Sleep so user applications have time to respond */ ++ g_timeout_add (data->manager->priv->system_action_idle_delay, ++ (GSourceFunc)system_action_idle_cb, ++ data); + } + + /* +@@ -1658,11 +1771,30 @@ static void + do_hybrid_sleep (CkManager *manager, + DBusGMethodInvocation *context) + { +- do_system_action (manager, +- context, +- PREFIX "/lib/ConsoleKit/scripts/ck-system-hybridsleep", +- CK_LOG_EVENT_SYSTEM_HIBERNATE, +- "Hybrid Sleep"); ++ SystemActionData *data; ++ ++ /* Emit the signal */ ++ g_signal_emit (manager, signals [PREPARE_FOR_SLEEP], 0, TRUE); ++ ++ /* Allocate and fill the data struct to pass to the idle cb */ ++ data = g_new0 (SystemActionData, 1); ++ if (data == NULL) { ++ g_critical ("failed to allocate memory to perform suspend\n"); ++ g_signal_emit (manager, signals [PREPARE_FOR_SLEEP], 0, FALSE); ++ return; ++ } ++ ++ data->manager = manager; ++ data->context = context; ++ data->command = PREFIX "/lib/ConsoleKit/scripts/ck-system-hybridsleep"; ++ data->event_type = CK_LOG_EVENT_SYSTEM_HIBERNATE; ++ data->description = "Hybrid Sleep"; ++ data->signal = PREPARE_FOR_SLEEP; ++ ++ /* Sleep so user applications have time to respond */ ++ g_timeout_add (data->manager->priv->system_action_idle_delay, ++ (GSourceFunc)system_action_idle_cb, ++ data); + } + + /* +@@ -3043,6 +3175,26 @@ ck_manager_class_init (CkManagerClass *klass) + g_cclosure_marshal_VOID__BOOLEAN, + G_TYPE_NONE, + 1, G_TYPE_BOOLEAN); ++ signals [PREPARE_FOR_SHUTDOWN] = ++ g_signal_new ("prepare-for-shutdown", ++ G_TYPE_FROM_CLASS (object_class), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (CkManagerClass, prepare_for_shutdown), ++ NULL, ++ NULL, ++ g_cclosure_marshal_VOID__BOOLEAN, ++ G_TYPE_NONE, ++ 1, G_TYPE_BOOLEAN); ++ signals [PREPARE_FOR_SLEEP] = ++ g_signal_new ("prepare-for-sleep", ++ G_TYPE_FROM_CLASS (object_class), ++ G_SIGNAL_RUN_LAST, ++ G_STRUCT_OFFSET (CkManagerClass, prepare_for_sleep), ++ NULL, ++ NULL, ++ g_cclosure_marshal_VOID__BOOLEAN, ++ G_TYPE_NONE, ++ 1, G_TYPE_BOOLEAN); + + dbus_g_object_type_install_info (CK_TYPE_MANAGER, &dbus_glib_ck_manager_object_info); + dbus_g_error_domain_register (CK_MANAGER_ERROR, NULL, CK_MANAGER_TYPE_ERROR); +@@ -3256,6 +3408,8 @@ ck_manager_init (CkManager *manager) + + manager->priv->inhibit_manager = ck_inhibit_manager_get (); + ++ manager->priv->system_action_idle_delay = 4 * 1000; ++ + create_seats (manager); + } + +diff --git a/src/ck-manager.h b/src/ck-manager.h +index 098d464..5bdc76e 100644 +--- a/src/ck-manager.h ++++ b/src/ck-manager.h +@@ -54,6 +54,10 @@ typedef struct + const char *sid); + void (* system_idle_hint_changed) (CkManager *manager, + gboolean idle_hint); ++ void (* prepare_for_shutdown) (CkManager *manager, ++ gboolean active); ++ void (* prepare_for_sleep) (CkManager *manager, ++ gboolean active); + } CkManagerClass; + + typedef enum +diff --git a/src/org.freedesktop.ConsoleKit.Manager.xml b/src/org.freedesktop.ConsoleKit.Manager.xml +index eb44d45..9b94120 100644 +--- a/src/org.freedesktop.ConsoleKit.Manager.xml ++++ b/src/org.freedesktop.ConsoleKit.Manager.xml +@@ -603,5 +603,36 @@ + + + ++ ++ ++ ++ TRUE when the system is starting to halt. ++ ++ ++ ++ ++ Emitted when the system is halting (active = TRUE). If ++ successful there will not be a FALSE signal emitted since ++ the system will poweroff or reboot. It will emit a FALSE ++ signal if the shutdown operation failed. ++ ++ ++ ++ ++ ++ ++ ++ TRUE when starting to sleep. ++ ++ ++ ++ ++ Emitted when the system is starting the sleep process. ++ It will emit with an active = FALSE when resuming from sleep ++ or if the sleep operation failed. ++ ++ ++ ++ + + +-- +2.2.1 + diff --git a/srcpkgs/ConsoleKit2/patches/0006-Keep-track-of-the-idle-callback.patch b/srcpkgs/ConsoleKit2/patches/0006-Keep-track-of-the-idle-callback.patch new file mode 100644 index 0000000000..becff9b1ef --- /dev/null +++ b/srcpkgs/ConsoleKit2/patches/0006-Keep-track-of-the-idle-callback.patch @@ -0,0 +1,206 @@ +From f7fea0b26f2a18f920564b6df017f915b4c5712f Mon Sep 17 00:00:00 2001 +From: Eric Koegel +Date: Mon, 17 Nov 2014 12:43:39 +0300 +Subject: [PATCH 06/12] Keep track of the idle callback + +This way we can prevent the user applications from attempting to +perform multiple system events at the same time. The additional +attempts will fail. +--- + src/ck-manager.c | 68 +++++++++++++++++++++++++++++++++++++++++++------------- + 1 file changed, 52 insertions(+), 16 deletions(-) + +diff --git a/src/ck-manager.c b/src/ck-manager.c +index 0110d89..e1bf022 100644 +--- a/src/ck-manager.c ++++ b/src/ck-manager.c +@@ -86,6 +86,9 @@ struct CkManagerPrivate + /* How long to delay after emitting the PREPARE_FOR_SHUTDOWN or + * PREPARE_FOR_SLEEP signal */ + guint system_action_idle_delay; ++ /* The idle callback id so we can detect multiple attempts to ++ * perform a system action at the same time */ ++ guint system_action_idle_id; + + CkInhibitManager *inhibit_manager; + }; +@@ -1239,7 +1242,7 @@ system_action_idle_cb(SystemActionData *data) + { + g_return_val_if_fail (data != NULL, FALSE); + +- /* Perform the action */ ++ /* Perform the action, it will handle the dbus_g_method_return */ + do_system_action (data->manager, + data->context, + data->command, +@@ -1250,6 +1253,9 @@ system_action_idle_cb(SystemActionData *data) + * or the operation failed. Either way we can signal to the apps */ + g_signal_emit (data->manager, signals [data->signal], 0, FALSE); + ++ /* reset this since we'll return FALSE here and kill the cb */ ++ data->manager->priv->system_action_idle_id = 0; ++ + g_free (data); + + return FALSE; +@@ -1261,6 +1267,13 @@ do_restart (CkManager *manager, + { + SystemActionData *data; + ++ /* Don't allow multiple system actions at the same time */ ++ if (manager->priv->system_action_idle_id != 0) { ++ g_error ("attempting to perform a system action while one is in progress"); ++ dbus_g_method_return (context, FALSE); ++ return; ++ } ++ + /* Emit the signal */ + g_signal_emit (manager, signals [PREPARE_FOR_SHUTDOWN], 0, TRUE); + +@@ -1280,9 +1293,9 @@ do_restart (CkManager *manager, + data->signal = PREPARE_FOR_SHUTDOWN; + + /* Sleep so user applications have time to respond */ +- g_timeout_add (data->manager->priv->system_action_idle_delay, +- (GSourceFunc)system_action_idle_cb, +- data); ++ manager->priv->system_action_idle_id = g_timeout_add (data->manager->priv->system_action_idle_delay, ++ (GSourceFunc)system_action_idle_cb, ++ data); + } + + /* +@@ -1347,6 +1360,13 @@ do_stop (CkManager *manager, + { + SystemActionData *data; + ++ /* Don't allow multiple system actions at the same time */ ++ if (manager->priv->system_action_idle_id != 0) { ++ g_error ("attempting to perform a system action while one is in progress"); ++ dbus_g_method_return (context, FALSE); ++ return; ++ } ++ + /* Emit the signal */ + g_signal_emit (manager, signals [PREPARE_FOR_SHUTDOWN], 0, TRUE); + +@@ -1355,6 +1375,7 @@ do_stop (CkManager *manager, + if (data == NULL) { + g_critical ("failed to allocate memory to perform shutdown\n"); + g_signal_emit (manager, signals [PREPARE_FOR_SHUTDOWN], 0, FALSE); ++ dbus_g_method_return (context, FALSE); + return; + } + +@@ -1366,9 +1387,9 @@ do_stop (CkManager *manager, + data->signal = PREPARE_FOR_SHUTDOWN; + + /* Sleep so user applications have time to respond */ +- g_timeout_add (data->manager->priv->system_action_idle_delay, +- (GSourceFunc)system_action_idle_cb, +- data); ++ manager->priv->system_action_idle_id = g_timeout_add (data->manager->priv->system_action_idle_delay, ++ (GSourceFunc)system_action_idle_cb, ++ data); + } + + gboolean +@@ -1563,6 +1584,13 @@ do_suspend (CkManager *manager, + { + SystemActionData *data; + ++ /* Don't allow multiple system actions at the same time */ ++ if (manager->priv->system_action_idle_id != 0) { ++ g_error ("attempting to perform a system action while one is in progress"); ++ dbus_g_method_return (context, FALSE); ++ return; ++ } ++ + /* Emit the signal */ + g_signal_emit (manager, signals [PREPARE_FOR_SLEEP], 0, TRUE); + +@@ -1571,6 +1599,7 @@ do_suspend (CkManager *manager, + if (data == NULL) { + g_critical ("failed to allocate memory to perform suspend\n"); + g_signal_emit (manager, signals [PREPARE_FOR_SLEEP], 0, FALSE); ++ dbus_g_method_return (context, FALSE); + return; + } + +@@ -1582,9 +1611,9 @@ do_suspend (CkManager *manager, + data->signal = PREPARE_FOR_SLEEP; + + /* Sleep so user applications have time to respond */ +- g_timeout_add (data->manager->priv->system_action_idle_delay, +- (GSourceFunc)system_action_idle_cb, +- data); ++ manager->priv->system_action_idle_id = g_timeout_add (data->manager->priv->system_action_idle_delay, ++ (GSourceFunc)system_action_idle_cb, ++ data); + } + + /* +@@ -1676,6 +1705,7 @@ do_hibernate (CkManager *manager, + if (data == NULL) { + g_critical ("failed to allocate memory to perform suspend\n"); + g_signal_emit (manager, signals [PREPARE_FOR_SLEEP], 0, FALSE); ++ dbus_g_method_return (context, FALSE); + return; + } + +@@ -1687,9 +1717,9 @@ do_hibernate (CkManager *manager, + data->signal = PREPARE_FOR_SLEEP; + + /* Sleep so user applications have time to respond */ +- g_timeout_add (data->manager->priv->system_action_idle_delay, +- (GSourceFunc)system_action_idle_cb, +- data); ++ manager->priv->system_action_idle_id = g_timeout_add (data->manager->priv->system_action_idle_delay, ++ (GSourceFunc)system_action_idle_cb, ++ data); + } + + /* +@@ -1781,6 +1811,7 @@ do_hybrid_sleep (CkManager *manager, + if (data == NULL) { + g_critical ("failed to allocate memory to perform suspend\n"); + g_signal_emit (manager, signals [PREPARE_FOR_SLEEP], 0, FALSE); ++ dbus_g_method_return (context, FALSE); + return; + } + +@@ -1792,9 +1823,9 @@ do_hybrid_sleep (CkManager *manager, + data->signal = PREPARE_FOR_SLEEP; + + /* Sleep so user applications have time to respond */ +- g_timeout_add (data->manager->priv->system_action_idle_delay, +- (GSourceFunc)system_action_idle_cb, +- data); ++ manager->priv->system_action_idle_id = g_timeout_add (data->manager->priv->system_action_idle_delay, ++ (GSourceFunc)system_action_idle_cb, ++ data); + } + + /* +@@ -3409,6 +3440,7 @@ ck_manager_init (CkManager *manager) + manager->priv->inhibit_manager = ck_inhibit_manager_get (); + + manager->priv->system_action_idle_delay = 4 * 1000; ++ manager->priv->system_action_idle_id = 0; + + create_seats (manager); + } +@@ -3440,6 +3472,10 @@ ck_manager_finalize (GObject *object) + g_object_unref (manager->priv->inhibit_manager); + } + ++ if (manager->priv->system_action_idle_id != 0) { ++ g_source_remove (manager->priv->system_action_idle_id); ++ } ++ + G_OBJECT_CLASS (ck_manager_parent_class)->finalize (object); + } + +-- +2.2.1 + diff --git a/srcpkgs/ConsoleKit2/patches/0007-openbsd-cleanups-and-sync-with-ConsoleKit-port.patch b/srcpkgs/ConsoleKit2/patches/0007-openbsd-cleanups-and-sync-with-ConsoleKit-port.patch new file mode 100644 index 0000000000..b9728e3973 --- /dev/null +++ b/srcpkgs/ConsoleKit2/patches/0007-openbsd-cleanups-and-sync-with-ConsoleKit-port.patch @@ -0,0 +1,225 @@ +From 80f8dc8620b8932aa922c470b4aa2cd2fe7afe50 Mon Sep 17 00:00:00 2001 +From: Antoine Jacoutot +Date: Thu, 27 Nov 2014 10:28:36 +0100 +Subject: [PATCH 07/12] openbsd: cleanups and sync with ConsoleKit port + +We never needed to use an external helper script with the original +ConsoleKit for ck-get-x11-*, so drop these. +Make sure we install the other tools and simplify the scripts in the +process. +--- + src/ck-vt-monitor.c | 2 +- + tools/Makefile.am | 4 ++++ + tools/openbsd/Makefile.am | 2 -- + tools/openbsd/ck-get-x11-display-device | 41 --------------------------------- + tools/openbsd/ck-get-x11-server-pid | 17 -------------- + tools/openbsd/ck-system-hibernate | 11 +-------- + tools/openbsd/ck-system-hybridsleep | 1 - + tools/openbsd/ck-system-restart | 11 +-------- + tools/openbsd/ck-system-stop | 17 +------------- + tools/openbsd/ck-system-suspend | 11 +-------- + 10 files changed, 9 insertions(+), 108 deletions(-) + delete mode 100755 tools/openbsd/ck-get-x11-display-device + delete mode 100755 tools/openbsd/ck-get-x11-server-pid + +diff --git a/src/ck-vt-monitor.c b/src/ck-vt-monitor.c +index 2b7f28b..1041f79 100644 +--- a/src/ck-vt-monitor.c ++++ b/src/ck-vt-monitor.c +@@ -408,7 +408,7 @@ static void + vt_add_watches (CkVtMonitor *vt_monitor) + { + #if defined (__sun) && !defined (HAVE_SYS_VT_H) || (defined(__OpenBSD__) && (!defined(__i386__) && !defined(__amd64__) && !defined(__powerpc__))) +- /* On OpenBSD, VT are only available on i386 and amd64 */ ++ /* On OpenBSD, VT are only available on i386, amd64 and powerpc */ + /* Best to do nothing if VT is not supported */ + #elif defined (__sun) && defined (HAVE_SYS_VT_H) + /* +diff --git a/tools/Makefile.am b/tools/Makefile.am +index 873f684..2948ad1 100644 +--- a/tools/Makefile.am ++++ b/tools/Makefile.am +@@ -14,6 +14,10 @@ if CK_COMPILE_FREEBSD + SUBDIRS += freebsd + endif + ++if CK_COMPILE_OPENBSD ++SUBDIRS += openbsd ++endif ++ + if CK_COMPILE_SOLARIS + SUBDIRS += solaris + endif +diff --git a/tools/openbsd/Makefile.am b/tools/openbsd/Makefile.am +index b06d00c..3fb3679 100644 +--- a/tools/openbsd/Makefile.am ++++ b/tools/openbsd/Makefile.am +@@ -13,8 +13,6 @@ script_SCRIPTS = \ + ck-system-suspend \ + ck-system-hibernate \ + ck-system-hybridsleep \ +- ck-get-x11-display-device \ +- ck-get-x11-server-pid \ + $(NULL) + + EXTRA_DIST = \ +diff --git a/tools/openbsd/ck-get-x11-display-device b/tools/openbsd/ck-get-x11-display-device +deleted file mode 100755 +index 7efc084..0000000 +--- a/tools/openbsd/ck-get-x11-display-device ++++ /dev/null +@@ -1,41 +0,0 @@ +-#!/bin/sh +- +-FSTAT="/usr/bin/fstat" +-GREP="/usr/bin/grep" +-AWK="/usr/bin/awk" +-SED="/usr/bin/sed" +-CAT="/bin/cat" +- +-dispnum=0 +-if [ x"$1" = x"--display" ]; then +- if [ $# != 2 ]; then +- echo "usage: $0 [--display DISPLAY]" +- exit 1 +- fi +- DISPLAY=$2 +-fi +-if [ ! -z "${DISPLAY}" ]; then +- dispnum=$(echo ${DISPLAY} | ${SED} -E -e 's|:([0-9]+).*|\1|') +-fi +- +-if [ ! -f "/tmp/.X${dispnum}-lock" ]; then +- echo "ERROR: Failed to find X lock file for display ${dispnum}" +- exit 1 +-fi +-pid=$(${CAT} "/tmp/.X${dispnum}-lock") +- +-device=$(${FSTAT} -p ${pid} | ${GREP} ttyv | ${AWK} '{print $8}') +- +-if [ -z "${device}" ]; then +- echo "ERROR: Failed to find TTY device for X server on display ${dispnum}" +- exit 1 +-fi +- +-ret="" +-for dev in ${device}; do +- if [ "${dev}" \> "${ret}" ]; then +- ret=${dev} +- fi +-done +- +-echo "/dev/${dev}" +diff --git a/tools/openbsd/ck-get-x11-server-pid b/tools/openbsd/ck-get-x11-server-pid +deleted file mode 100755 +index 05c433e..0000000 +--- a/tools/openbsd/ck-get-x11-server-pid ++++ /dev/null +@@ -1,17 +0,0 @@ +-#!/bin/sh +- +-SED="/usr/bin/sed" +-CAT="/bin/cat" +- +-dispnum=0 +-if [ ! -z "${DISPLAY}" ]; then +- dispnum=$(echo ${DISPLAY} | ${SED} -E -e 's|:([0-9]+).*|\1|') +-fi +- +-if [ ! -f "/tmp/.X${dispnum}-lock" ]; then +- echo "ERROR: Failed to find X lock file for display ${dispnum}" +- exit 1 +-fi +-pid=$(${CAT} "/tmp/.X${dispnum}-lock") +- +-echo ${pid} +diff --git a/tools/openbsd/ck-system-hibernate b/tools/openbsd/ck-system-hibernate +index 2f35fe4..dd2568a 100644 +--- a/tools/openbsd/ck-system-hibernate ++++ b/tools/openbsd/ck-system-hibernate +@@ -1,12 +1,3 @@ + #!/bin/sh + +-#Try for common tools +-if [ -x "/sbin/ZZZ" ] ; then +- /sbin/ZZZ +- exit $? +-elif [ -x "/usr/sbin/ZZZ" ] ; then +- /usr/sbin/ZZZ +- exit $? +-else +- exit 1 +-fi ++/usr/sbin/ZZZ +diff --git a/tools/openbsd/ck-system-hybridsleep b/tools/openbsd/ck-system-hybridsleep +index 8405318..9dda927 100644 +--- a/tools/openbsd/ck-system-hybridsleep ++++ b/tools/openbsd/ck-system-hybridsleep +@@ -2,4 +2,3 @@ + + # Not implemented + exit 1 +- +diff --git a/tools/openbsd/ck-system-restart b/tools/openbsd/ck-system-restart +index 8e0664e..8272348 100755 +--- a/tools/openbsd/ck-system-restart ++++ b/tools/openbsd/ck-system-restart +@@ -1,12 +1,3 @@ + #!/bin/sh + +-#Try for common tools +-if [ -x "/sbin/shutdown" ] ; then +- /sbin/shutdown -r now +- exit $? +-elif [ -x "/usr/sbin/shutdown" ] ; then +- /usr/sbin/shutdown -r now +- exit $? +-else +- exit 1 +-fi ++/sbin/shutdown -r now +diff --git a/tools/openbsd/ck-system-stop b/tools/openbsd/ck-system-stop +index 7bdb13d..8ab51af 100755 +--- a/tools/openbsd/ck-system-stop ++++ b/tools/openbsd/ck-system-stop +@@ -1,18 +1,3 @@ + #!/bin/sh + +-unsupported() { +- echo "org.freedesktop.Hal.Device.SystemPowerManagement.NotSupported" >&2 +- echo "No shutdown command found" >&2 +- exit 1 +-} +- +-#Try for common tools +-if [ -x "/sbin/shutdown" ] ; then +- /sbin/shutdown -hp now +- exit $? +-elif [ -x "/usr/sbin/shutdown" ] ; then +- /usr/sbin/shutdown -p now +- exit $? +-else +- unsupported +-fi ++/sbin/shutdown -hp now +diff --git a/tools/openbsd/ck-system-suspend b/tools/openbsd/ck-system-suspend +index 092165c..27304af 100644 +--- a/tools/openbsd/ck-system-suspend ++++ b/tools/openbsd/ck-system-suspend +@@ -1,12 +1,3 @@ + #!/bin/sh + +-#Try for common tools +-if [ -x "/sbin/zzz" ] ; then +- /sbin/zzz +- exit $? +-elif [ -x "/usr/sbin/zzz" ] ; then +- /usr/sbin/zzz +- exit $? +-else +- exit 1 +-fi ++/usr/sbin/zzz +-- +2.2.1 + diff --git a/srcpkgs/ConsoleKit2/patches/0008-Fix-pam-foreground-compat-install.patch b/srcpkgs/ConsoleKit2/patches/0008-Fix-pam-foreground-compat-install.patch new file mode 100644 index 0000000000..16dab9c7b9 --- /dev/null +++ b/srcpkgs/ConsoleKit2/patches/0008-Fix-pam-foreground-compat-install.patch @@ -0,0 +1,47 @@ +From 7207144ad6ce57c600a6e277c1bd3169ef627504 Mon Sep 17 00:00:00 2001 +From: Eric Koegel +Date: Mon, 17 Nov 2014 08:44:43 +0300 +Subject: [PATCH 08/12] Fix pam-foreground-compat install + +The pam-foreground-compat.ck script should be installed without +requring udev. +--- + tools/Makefile.am | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +diff --git a/tools/Makefile.am b/tools/Makefile.am +index 2948ad1..774b4ed 100644 +--- a/tools/Makefile.am ++++ b/tools/Makefile.am +@@ -166,20 +166,21 @@ udev_acl_CFLAGS = \ + $(AM_CFLAGS) \ + $(NULL) + ++install-exec-hook: ++ mkdir -p $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d ++ mkdir -p $(DESTDIR)$(UDEVDIR) ++ ln -sf $(libexecdir)/udev-acl $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d/udev-acl.ck ++ ln -sf $(libexecdir)/udev-acl $(DESTDIR)$(UDEVDIR)/udev-acl ++endif ++ + scriptdir = $(prefix)/lib/ConsoleKit/scripts + script_SCRIPTS = \ + pam-foreground-compat.ck \ + $(NULL) + +- +-install-exec-hook: +- mkdir -p $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d ++install-data-hook: + mkdir -p $(DESTDIR)$(prefix)/lib/ConsoleKit/run-session.d +- mkdir -p $(DESTDIR)$(UDEVDIR) +- ln -sf $(libexecdir)/udev-acl $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d/udev-acl.ck +- ln -sf $(libexecdir)/udev-acl $(DESTDIR)$(UDEVDIR)/udev-acl + ln -sf $(prefix)/lib/ConsoleKit/scripts/pam-foreground-compat.ck $(DESTDIR)$(prefix)/lib/ConsoleKit/run-session.d/pam-foreground-compat.ck +-endif + + EXTRA_DIST = \ + $(script_SCRIPTS) \ +-- +2.2.1 + diff --git a/srcpkgs/ConsoleKit2/patches/0009-Revert-Fix-crash-on-logout-login-via-SunRay.patch b/srcpkgs/ConsoleKit2/patches/0009-Revert-Fix-crash-on-logout-login-via-SunRay.patch new file mode 100644 index 0000000000..10b1bdad3f --- /dev/null +++ b/srcpkgs/ConsoleKit2/patches/0009-Revert-Fix-crash-on-logout-login-via-SunRay.patch @@ -0,0 +1,32 @@ +From 40137c006c341542fec8be139b3acea78afb584e Mon Sep 17 00:00:00 2001 +From: Eric Koegel +Date: Sat, 6 Dec 2014 20:16:32 +0300 +Subject: [PATCH 09/12] Revert "Fix crash on logout/login via SunRay" + +This reverts commit 417e387750920b9e092705863a863e71a77ea431. + +Causes a regression with polkit authorizations. See: +https://github.com/ConsoleKit2/ConsoleKit2/issues/16 +https://github.com/ConsoleKit2/ConsoleKit2/issues/12 +--- + src/ck-seat.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/src/ck-seat.c b/src/ck-seat.c +index 7f79fea..6e6800f 100644 +--- a/src/ck-seat.c ++++ b/src/ck-seat.c +@@ -514,9 +514,7 @@ change_active_session (CkSeat *seat, + * must be sent when the database dump is finished it is + * important that the '-full' signalled is emitted first. */ + +- if (CK_IS_SESSION (old_session)) { +- g_signal_emit (seat, signals [ACTIVE_SESSION_CHANGED_FULL], 0, old_session, session); +- } ++ g_signal_emit (seat, signals [ACTIVE_SESSION_CHANGED_FULL], 0, old_session, session); + g_signal_emit (seat, signals [ACTIVE_SESSION_CHANGED], 0, ssid); + + if (old_session != NULL) { +-- +2.2.1 + diff --git a/srcpkgs/ConsoleKit2/patches/0010-Add-with-rundir-configure-flag.patch b/srcpkgs/ConsoleKit2/patches/0010-Add-with-rundir-configure-flag.patch new file mode 100644 index 0000000000..fd02025863 --- /dev/null +++ b/srcpkgs/ConsoleKit2/patches/0010-Add-with-rundir-configure-flag.patch @@ -0,0 +1,1349 @@ +From aa548ebc044767ced3c1a22f8b8086c910a27831 Mon Sep 17 00:00:00 2001 +From: Robby Workman +Date: Mon, 8 Dec 2014 00:55:13 -0600 +Subject: [PATCH 10/12] Add --with-rundir configure flag + +This allows use of /run on tmpfs instead of /var/run +without downstream symlink magic or patches. +--- + configure.ac | 20 +- + doc/console-kit-daemon.1m | 472 ------------------------------------------- + doc/console-kit-daemon.1m.in | 472 +++++++++++++++++++++++++++++++++++++++++++ + src/Makefile.am | 7 +- + src/ck-inhibit.c | 12 +- + src/ck-manager.c | 10 +- + src/main.c | 2 +- + tools/70-udev-acl.rules | 76 ------- + tools/70-udev-acl.rules.in | 76 +++++++ + tools/Makefile.am | 1 + + tools/udev-acl.c | 2 +- + 11 files changed, 585 insertions(+), 565 deletions(-) + delete mode 100644 doc/console-kit-daemon.1m + create mode 100644 doc/console-kit-daemon.1m.in + delete mode 100644 tools/70-udev-acl.rules + create mode 100644 tools/70-udev-acl.rules.in + +diff --git a/configure.ac b/configure.ac +index d45a937..dd1f5bb 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -163,6 +163,21 @@ fi + Z_LIBS="${Z_LIBS} -lz" + AC_SUBST(Z_LIBS) + ++ ++dnl --------------------------------------------------------------------------- ++dnl - Path to rundir e.g. /var/run ++dnl --------------------------------------------------------------------------- ++ ++AC_ARG_WITH(rundir, ++ [AS_HELP_STRING([--with-rundir=],[run directory location, e.g. /var/run])]) ++if ! test -z "$with_rundir" ; then ++ RUNDIR="$with_rundir" ++else ++ RUNDIR="$localstatedir/run" ++fi ++AC_SUBST(RUNDIR) ++ ++ + dnl --------------------------------------------------------------------------- + dnl - PID file + dnl --------------------------------------------------------------------------- +@@ -173,7 +188,7 @@ AC_ARG_WITH(pid-file, + if ! test -z "$with_pid_file"; then + CONSOLE_KIT_PID_FILE=$with_pid_file + else +- CONSOLE_KIT_PID_FILE=${localstatedir}/run/ConsoleKit/pid ++ CONSOLE_KIT_PID_FILE=${RUNDIR}/ConsoleKit/pid + fi + + AC_SUBST(CONSOLE_KIT_PID_FILE) +@@ -472,6 +487,7 @@ AC_SUBST(PACKAGE) + AC_CONFIG_FILES([ + Makefile + src/Makefile ++tools/70-udev-acl.rules + tools/Makefile + tools/linux/Makefile + tools/freebsd/Makefile +@@ -479,6 +495,7 @@ tools/openbsd/Makefile + tools/solaris/Makefile + data/Makefile + doc/Makefile ++doc/console-kit-daemon.1m + doc/dbus/ConsoleKit.xml + doc/dbus/Makefile + libck-connector/Makefile +@@ -500,6 +517,7 @@ echo " + sbindir: ${sbindir} + sysconfdir: ${sysconfdir} + localstatedir: ${localstatedir} ++ rundir: ${RUNDIR} + datadir: ${datadir} + source code location: ${srcdir} + compiler: ${CC} +diff --git a/doc/console-kit-daemon.1m b/doc/console-kit-daemon.1m +deleted file mode 100644 +index 1e1a618..0000000 +--- a/doc/console-kit-daemon.1m ++++ /dev/null +@@ -1,472 +0,0 @@ +-'\" te +-.TH console-kit-daemon 1m "24 Oct 2009" "SunOS 5.11" "Maintenance Commands" +-.SH "NAME" +-console-kit-daemon \- ConsoleKit daemon +-.SH "SYNOPSIS" +-.PP +-\fBconsole-kit-daemon\fR [-\fB-debug\fR] [-\fB-help\fR] [-\fB-no-daemon\fR] [-\fB-timed-exit\fR] +-.SH "DESCRIPTION" +-.PP +-\fBconsole-kit-daemon\fR is a service for defining and tracking users, login +-sessions and seats\&. It provides interfaces for managing switching sessions +-and session migration when using mechanisms such as Virtual Terminals (VT)\&. +-ConsoleKit provides a number of interfaces to specify what displays are managed +-by the display manager, and how\&. +-.PP +-ConsoleKit maintains a database of which users are logged into the system\&. +-ConsoleKit groups sessions by seats which represent a set of hardware (usually +-a keyboard and mouse)\&. Other process communicate with ConsoleKit via D-Bus\&. +-.PP +-One session leader process is responsible for asking \fBconsole-kit-daemon\fR +-to open a new session\&. In the typical case, the session leader would be a +-ConsoleKit enabled display manager, such as GDM\&. This leader makes a +-connection to the D-Bus system bus and asks \fBconsole-kit-daemon\fR to open a +-session when needed\&. +-.PP +-If the operation succeeds, \fBconsole-kit-daemon\fR will return a cookie to the +-session leader\&. The session leader should store this variable in the +-environment as XDG_SESSION_COOKIE so that it may be shared with its child +-processes\&. The environment variable contains the UUID used to tie processes to +-a session\&. +-.PP +-At this point the session will be registered with ConsoleKit and a particular +-set of information about the session will be stored along with it\&. +-.PP +-The Session will remain open until the Session Leader disconnects from the +-D-Bus system bus\&. The session will be removed from its seat, and deregistered\&. +-.PP +-Various other programs need to know information about running user sessions, +-such as the Fast User Switch Applet and other mechanisms for switching the +-console to use a different VT display\&. Such programs make use of ConsoleKit +-interfaces to determine if user switching is supported and to manage the +-switching of different sessions on the same seat\&. +-.PP +-ConsoleKit provides a pam_ck_connector so that non-graphical logins (e\&.g\&. +-telnet, ssh, etc\&.) are registered with ConsoleKit\&. This functionality works +-if this PAM module is enabled in the +-\fBpam\&.conf\fR(4) configuration\&. Thus ConsoleKit can be +-used as a utmp/wtmp replacement since it stores a superset of the information +-as in the utmp/wtmp database\&. +-.PP +-The ConsoleKit database is stored in the file +-\fB/var/run/ConsoleKit/database\fR\&. It stores information about +-active Seats, Sessions, and the current SessionLeader\&. +-.SH "OPTIONS" +-.PP +-The following options are supported: +-.sp +-.ne 2 +-.mk +-\fB-\fB-debug\fR\fR +-.in +24n +-.rt +-Enable debug output\&. +-.sp +-.sp 1 +-.in -24n +-.sp +-.ne 2 +-.mk +-\fB-\fBh\fR, -\fB-help\fR\fR +-.in +24n +-.rt +-Display detailed usage message\&. +-.sp +-.sp 1 +-.in -24n +-.sp +-.ne 2 +-.mk +-\fB-\fB-no-daemon\fR\fR +-.in +24n +-.rt +-Avoid starting \fBconsole-kit-daemon\fR as a daemon\&. Useful for debugging\&. +-.sp +-.sp 1 +-.in -24n +-.sp +-.ne 2 +-.mk +-\fB-\fB-timed-exit\fR\fR +-.in +24n +-.rt +-Exit after 30 seconds\&. Useful for debugging\&. +-.sp +-.sp 1 +-.in -24n +-.SH "ENVIRONMENT VARIABLES" +-.PP +-See +-\fBenviron\fR(5) +-for descriptions of environment variables\&. +-.sp +-.ne 2 +-.mk +-\fB\fBDISPLAY\fR\fR +-.sp .6 +-.in +4 +-This environment variable corresponds to the Xserver display value associated +-with the ConsoleKit session\&. +-.sp +-.sp 1 +-.in -4 +-.sp +-.ne 2 +-.mk +-\fB\fBXDG_SESSION_COOKIE\fR\fR +-.sp .6 +-.in +4 +-ConsoleKit provides this environment variable to the session leader\&. The +-session leader is expected to ensure this is set for the session process +-started\&. It contains a UUID used to tie the processes to the session\&. This is +-used to support user switching on displays that support it (currently only +-graphical VT displays on the console)\&. +-.sp +-.sp 1 +-.in -4 +-.PP +-The following environment variables are set when \fBconsole-kit-daemon\fR +-runs the \fBrun-seat\&.d\fR scripts\&. These values correspond to those +-values returned by the \fBck-list-session\fR(1) utility\&. +-.sp +-.ne 2 +-.mk +-\fB\fBCK_SESSION_SEAT_ID\fR\fR +-.sp .6 +-.in +4 +-The seat ID associated with the session\&. +-.sp +-.sp 1 +-.in -4 +-.sp +-.ne 2 +-.mk +-\fB\fBCK_SESSION_SEAT_UID\fR\fR +-.sp .6 +-.in +4 +-The user id associated with the session +-.sp +-.sp 1 +-.in -4 +-.sp +-.ne 2 +-.mk +-\fB\fBCK_SESSION_DISPLAY_DEVICE\fR\fR +-.sp .6 +-.in +4 +-The display device associated with the session\&. +-.sp +-.sp 1 +-.in -4 +-.sp +-.ne 2 +-.mk +-\fB\fBCK_SESSION_X11_DISPLAY_DEVICE\fR\fR +-.sp .6 +-.in +4 +-The value of the display device that the X11 display for the session is +-connected to\&. If there is no x11-display set, then this value is undefined\&. +-.sp +-.sp 1 +-.in -4 +-.sp +-.ne 2 +-.mk +-\fB\fBCK_SESSION_X11_DISPLAY\fR\fR +-.sp .6 +-.in +4 +-The value of the X11 DISPLAY environment variable for this session if one is +-present\&. +-.sp +-.sp 1 +-.in -4 +-.sp +-.ne 2 +-.mk +-\fB\fBCK_SESSION_REMOTE_HOST_NAME\fR\fR +-.sp .6 +-.in +4 +-If the session is not local, the value is the host name associated with the +-session\&. If the session is local, the value is empty\&. +-.sp +-.sp 1 +-.in -4 +-.sp +-.ne 2 +-.mk +-\fB\fBCK_SESSION_IS_ACTIVE\fR\fR +-.sp .6 +-.in +4 +-The value is "TRUE" if the session is active on the seat to which it +-is attached, and "FALSE" otherwise\&. +-.sp +-.sp 1 +-.in -4 +-.sp +-.ne 2 +-.mk +-\fB\fBCK_SESSION_IS_LOCAL\fR\fR +-.sp .6 +-.in +4 +-The value is "TRUE" if the session is local, and "FALSE" +-if remote\&. +-.sp +-.sp 1 +-.in -4 +-.sp +-.ne 2 +-.mk +-\fB\fBCK_SESSION_IS_DYNAMIC\fR\fR +-.sp .6 +-.in +4 +-The value is "TRUE" if the session was started with +-\fBck-seat-tool\fR, and "FALSE" otherwise\&. +-.sp +-.sp 1 +-.in -4 +-.SH "EXTENDED DESCRIPTION" +-.SS "ConsoleKit Seat Configuration" +-.PP +-ConsoleKit seat configuration files are located in the +-/etc/ConsoleKit/seats\&.d directory\&. Each seat +-configuration file ends with the \fB\&.seat\fR suffix\&. ConsoleKit +-provides a default seat file named \fB00-primary\&.seat\fR\&. +-Additional seat configuration files may be added\&. These files are in standard +-INI format\&. +-.PP +-The settings below are in +-"group/key=\fIdefault_value\fR" format, and show +-the default values of the \fB00-primary\&.seat\fR file\&. For +-example, to specify a different "Seat Entry/Name" value, you would +-modify the this file so it contains these lines: +-.PP +-.nf +-[Seat Entry] +-[\&.\&.\&.] +-Name=Customized seat name +-.fi +-.PP +-The following keys are supported for configuring ConsoleKit seats: +-.sp +-.ne 2 +-.mk +-\fBSeat Entry/Version=1\&.0\fR +-.sp .6 +-.in +4 +-Version number of the seat file\&. This specifies the version number of the +-configuration file format used\&. Currently only the value "1\&.0" is +-supported\&. +-.sp +-.sp 1 +-.in -4 +-.sp +-.ne 2 +-.mk +-\fBSeat Entry/Name=Primary seat\fR +-.sp .6 +-.in +4 +-Name of the seat\&. +-.sp +-.sp 1 +-.in -4 +-.sp +-.ne 2 +-.mk +-\fBSeat Entry/ID=StaticSeat\fR +-.sp .6 +-.in +4 +-Specifies the unique ID of the seat\&. If the value is NULL, then +-\fBconsole-kit-daemon\fR will provide a value\&. The ID may only contain the +-ASCII characters [A-Z][a=z][0-9]_"\&. +-.sp +-.sp 1 +-.in -4 +-.sp +-.ne 2 +-.mk +-\fBSeat Entry/Hidden=false\fR +-.sp .6 +-.in +4 +-If this value is set to "false", then ConsoleKit will create this +-seat\&. Otherwise, the seat will not be created\&. +-.sp +-.sp 1 +-.in -4 +-.sp +-.ne 2 +-.mk +-\fBSeat Entry/Devices\fR +-.sp .6 +-.in +4 +-This value is not currently supported\&. In the future, it is planned that +-ConsoleKit will provide the ability to manage how device permissions are +-managed, and this key is a placeholder\&. +-.sp +-.sp 1 +-.in -4 +-.sp +-.ne 2 +-.mk +-\fBSeat Entry/Sessions=Local\fR +-.sp .6 +-.in +4 +-List of sessions to start on the seat, separated by the ";" +-character\&. Each session must be defined in a ConsoleKit session configuration +-file named +-\fB/etc/ConsoleKit/sessions\&.d/\fIsessions\fR\&.session\fR where \fIsessions\fR is the value of this key\&. +-.sp +-.sp 1 +-.in -4 +-.SS "ConsoleKit Session Configuration" +-.PP +-ConsoleKit session configuration files are located in the +-/etc/ConsoleKit/sessions\&.d directory\&. Each session +-configuration file ends with the \fB\&.session\fR suffix\&. +-Additional seat configuration files may be added\&. These files are in standard +-INI format\&. +-.PP +-The settings below are in +-"group/key" format, so to specify the "Session Entry/Name" +-value, the file shoulld contain these lines: +-.PP +-.nf +-[Session Entry] +-[\&.\&.\&.] +-Name=Customized Session +-.fi +-.PP +-The following keys are supported for configuring ConsoleKit sessions: +-.sp +-.ne 2 +-.mk +-\fBSession Entry/Name\fR +-.sp .6 +-.in +4 +-Unique name of the session\&. +-.sp +-.sp 1 +-.in -4 +-.sp +-.ne 2 +-.mk +-\fBSession Entry/Type\fR +-.sp .6 +-.in +4 +-Type of the session +-.sp +-.sp 1 +-.in -4 +-.sp +-.ne 2 +-.mk +-\fBSession Entry/Description\fR +-.sp .6 +-.in +4 +-Description of the session\&. +-.sp +-.sp 1 +-.in -4 +-.sp +-.ne 2 +-.mk +-\fBSession Entry/DisplayTemplate\fR +-.sp .6 +-.in +4 +-This specifies the display type to be used with the session\&. This corresponds +-to the file +-\fB/etc/ConsoleKit/displays\&.d/\fIdisplay_template\fR\&.display\fR +-where \fIdisplay_template\fR is the value of this key\&. +-.sp +-.sp 1 +-.in -4 +-.sp +-.ne 2 +-.mk +-\fBLocal/\fIvariable\fR\fR +-.sp .6 +-.in +4 +-The ConsoleKit display configuration file associated with the +-"Entry/DisplayTemplate" key specifies the command to run to launch +-the display\&. This command is defined in the ConsoleKit display configuration +-file in the key "X11/Exec"\&. This command can include variables that +-begin with the "$" character, such as "$display"\&. The +-values to be used for these variables can be defined in this section\&. So if +-the session configuration file contains the value +-"Local/display=:0", this will cause the variable used when launching +-the command to be replaced with the value "0"\&. +-.sp +-.sp 1 +-.in -4 +-.SS "ConsoleKit System Restart and Stop" +-.PP +-\fBconsole-kit-daemon\fR provides D-Bus interfaces that will restart or stop +-the system\&. When \fBconsole-kit-daemon\fR receives a D-Bus request to restart +-the system, it will run the +-\fB/usr/lib/ConsoleKit/scripts/ck-system-restart\fR script if +-the user has privilege to do this operation\&. When \fBconsole-kit-daemon\fR +-receives a D-Bus request to stop the system, it will run the +-\fB/usr/lib/ConsoleKit/scripts/ck-system-stop\fR script if the +-user has privilege to do this operation\&. +-.SH "EXAMPLES" +-.PP +-\fBExample 1: To start the ConsoleKit daemon\fR +-.PP +-.PP +-.nf +-example% \fBconsole-kit-daemon\fR +-.fi +-.PP +-\fBExample 2: To configure ConsoleKit to start multiple sessions on a single seat\fR +-.PP +-To start two local displays: DISPLAY ":0" on vt7 and DISPLAY +-":1" on "vt8", +-edit the \fB00-primary\&.seat\fR file as follows: +-.PP +-.nf +-[Seat Entry] +-Version=1\&.0 +-Name=Primary seat +-Description=start static displays :0 on vt7 and :1 on vt8 +-Hidden=false +-Devices= +-Sessions=Local;Local2; +-.fi +-.PP +-Then, in addition to the original +-\fB/etc/ConsoleKit/sessions\&.d/Local\&.session\fR file, add the +-following \fB/etc/ConsoleKit/sessions\&.d/Local2\&.session\fR file: +-.PP +-.nf +-[Session Entry] +-Name=Local +-Type=LoginWindow +-Description=Local Login Screen +-DisplayTemplate=Local +- +-[Local] +-display=:1 +-vt=/dev/vt/8 +-.fi +-.PP +-.SH "SEE ALSO" +-.PP +-More information can be found at: +-.PP +-\fBhttps://github\&.com/ConsoleKit2/ConsoleKit2\fR +-.PP +-\fBck-history\fR(1), +-\fBck-launch-session\fR(1), +-\fBck-list-sessions\fR(1), +-\fBsvcadm\fR(1m), +-\fBenviron\fR(5), +-\fBsmf\fR(5), +-\fBconsole\fR(4) +-.SH "NOTES" +-.PP +-Brian Cameron, Sun Microsystems Inc\&., 2009\&. +-Copyright (c) 2009 by Sun Microsystems, Inc\&. +-.PP +-Some of the documentation in this manpage is from the ConsoleKit documentation +-written by William Jon McCann\&. +-...\" created by instant / solbook-to-man, Sat 24 Oct 2009, 14:10 +-...\" LSARC 2009/432 ConsoleKit +diff --git a/doc/console-kit-daemon.1m.in b/doc/console-kit-daemon.1m.in +new file mode 100644 +index 0000000..edecf0e +--- /dev/null ++++ b/doc/console-kit-daemon.1m.in +@@ -0,0 +1,472 @@ ++'\" te ++.TH console-kit-daemon 1m "24 Oct 2009" "SunOS 5.11" "Maintenance Commands" ++.SH "NAME" ++console-kit-daemon \- ConsoleKit daemon ++.SH "SYNOPSIS" ++.PP ++\fBconsole-kit-daemon\fR [-\fB-debug\fR] [-\fB-help\fR] [-\fB-no-daemon\fR] [-\fB-timed-exit\fR] ++.SH "DESCRIPTION" ++.PP ++\fBconsole-kit-daemon\fR is a service for defining and tracking users, login ++sessions and seats\&. It provides interfaces for managing switching sessions ++and session migration when using mechanisms such as Virtual Terminals (VT)\&. ++ConsoleKit provides a number of interfaces to specify what displays are managed ++by the display manager, and how\&. ++.PP ++ConsoleKit maintains a database of which users are logged into the system\&. ++ConsoleKit groups sessions by seats which represent a set of hardware (usually ++a keyboard and mouse)\&. Other process communicate with ConsoleKit via D-Bus\&. ++.PP ++One session leader process is responsible for asking \fBconsole-kit-daemon\fR ++to open a new session\&. In the typical case, the session leader would be a ++ConsoleKit enabled display manager, such as GDM\&. This leader makes a ++connection to the D-Bus system bus and asks \fBconsole-kit-daemon\fR to open a ++session when needed\&. ++.PP ++If the operation succeeds, \fBconsole-kit-daemon\fR will return a cookie to the ++session leader\&. The session leader should store this variable in the ++environment as XDG_SESSION_COOKIE so that it may be shared with its child ++processes\&. The environment variable contains the UUID used to tie processes to ++a session\&. ++.PP ++At this point the session will be registered with ConsoleKit and a particular ++set of information about the session will be stored along with it\&. ++.PP ++The Session will remain open until the Session Leader disconnects from the ++D-Bus system bus\&. The session will be removed from its seat, and deregistered\&. ++.PP ++Various other programs need to know information about running user sessions, ++such as the Fast User Switch Applet and other mechanisms for switching the ++console to use a different VT display\&. Such programs make use of ConsoleKit ++interfaces to determine if user switching is supported and to manage the ++switching of different sessions on the same seat\&. ++.PP ++ConsoleKit provides a pam_ck_connector so that non-graphical logins (e\&.g\&. ++telnet, ssh, etc\&.) are registered with ConsoleKit\&. This functionality works ++if this PAM module is enabled in the ++\fBpam\&.conf\fR(4) configuration\&. Thus ConsoleKit can be ++used as a utmp/wtmp replacement since it stores a superset of the information ++as in the utmp/wtmp database\&. ++.PP ++The ConsoleKit database is stored in the file ++\fB@RUNDIR@/ConsoleKit/database\fR\&. It stores information about ++active Seats, Sessions, and the current SessionLeader\&. ++.SH "OPTIONS" ++.PP ++The following options are supported: ++.sp ++.ne 2 ++.mk ++\fB-\fB-debug\fR\fR ++.in +24n ++.rt ++Enable debug output\&. ++.sp ++.sp 1 ++.in -24n ++.sp ++.ne 2 ++.mk ++\fB-\fBh\fR, -\fB-help\fR\fR ++.in +24n ++.rt ++Display detailed usage message\&. ++.sp ++.sp 1 ++.in -24n ++.sp ++.ne 2 ++.mk ++\fB-\fB-no-daemon\fR\fR ++.in +24n ++.rt ++Avoid starting \fBconsole-kit-daemon\fR as a daemon\&. Useful for debugging\&. ++.sp ++.sp 1 ++.in -24n ++.sp ++.ne 2 ++.mk ++\fB-\fB-timed-exit\fR\fR ++.in +24n ++.rt ++Exit after 30 seconds\&. Useful for debugging\&. ++.sp ++.sp 1 ++.in -24n ++.SH "ENVIRONMENT VARIABLES" ++.PP ++See ++\fBenviron\fR(5) ++for descriptions of environment variables\&. ++.sp ++.ne 2 ++.mk ++\fB\fBDISPLAY\fR\fR ++.sp .6 ++.in +4 ++This environment variable corresponds to the Xserver display value associated ++with the ConsoleKit session\&. ++.sp ++.sp 1 ++.in -4 ++.sp ++.ne 2 ++.mk ++\fB\fBXDG_SESSION_COOKIE\fR\fR ++.sp .6 ++.in +4 ++ConsoleKit provides this environment variable to the session leader\&. The ++session leader is expected to ensure this is set for the session process ++started\&. It contains a UUID used to tie the processes to the session\&. This is ++used to support user switching on displays that support it (currently only ++graphical VT displays on the console)\&. ++.sp ++.sp 1 ++.in -4 ++.PP ++The following environment variables are set when \fBconsole-kit-daemon\fR ++runs the \fBrun-seat\&.d\fR scripts\&. These values correspond to those ++values returned by the \fBck-list-session\fR(1) utility\&. ++.sp ++.ne 2 ++.mk ++\fB\fBCK_SESSION_SEAT_ID\fR\fR ++.sp .6 ++.in +4 ++The seat ID associated with the session\&. ++.sp ++.sp 1 ++.in -4 ++.sp ++.ne 2 ++.mk ++\fB\fBCK_SESSION_SEAT_UID\fR\fR ++.sp .6 ++.in +4 ++The user id associated with the session ++.sp ++.sp 1 ++.in -4 ++.sp ++.ne 2 ++.mk ++\fB\fBCK_SESSION_DISPLAY_DEVICE\fR\fR ++.sp .6 ++.in +4 ++The display device associated with the session\&. ++.sp ++.sp 1 ++.in -4 ++.sp ++.ne 2 ++.mk ++\fB\fBCK_SESSION_X11_DISPLAY_DEVICE\fR\fR ++.sp .6 ++.in +4 ++The value of the display device that the X11 display for the session is ++connected to\&. If there is no x11-display set, then this value is undefined\&. ++.sp ++.sp 1 ++.in -4 ++.sp ++.ne 2 ++.mk ++\fB\fBCK_SESSION_X11_DISPLAY\fR\fR ++.sp .6 ++.in +4 ++The value of the X11 DISPLAY environment variable for this session if one is ++present\&. ++.sp ++.sp 1 ++.in -4 ++.sp ++.ne 2 ++.mk ++\fB\fBCK_SESSION_REMOTE_HOST_NAME\fR\fR ++.sp .6 ++.in +4 ++If the session is not local, the value is the host name associated with the ++session\&. If the session is local, the value is empty\&. ++.sp ++.sp 1 ++.in -4 ++.sp ++.ne 2 ++.mk ++\fB\fBCK_SESSION_IS_ACTIVE\fR\fR ++.sp .6 ++.in +4 ++The value is "TRUE" if the session is active on the seat to which it ++is attached, and "FALSE" otherwise\&. ++.sp ++.sp 1 ++.in -4 ++.sp ++.ne 2 ++.mk ++\fB\fBCK_SESSION_IS_LOCAL\fR\fR ++.sp .6 ++.in +4 ++The value is "TRUE" if the session is local, and "FALSE" ++if remote\&. ++.sp ++.sp 1 ++.in -4 ++.sp ++.ne 2 ++.mk ++\fB\fBCK_SESSION_IS_DYNAMIC\fR\fR ++.sp .6 ++.in +4 ++The value is "TRUE" if the session was started with ++\fBck-seat-tool\fR, and "FALSE" otherwise\&. ++.sp ++.sp 1 ++.in -4 ++.SH "EXTENDED DESCRIPTION" ++.SS "ConsoleKit Seat Configuration" ++.PP ++ConsoleKit seat configuration files are located in the ++/etc/ConsoleKit/seats\&.d directory\&. Each seat ++configuration file ends with the \fB\&.seat\fR suffix\&. ConsoleKit ++provides a default seat file named \fB00-primary\&.seat\fR\&. ++Additional seat configuration files may be added\&. These files are in standard ++INI format\&. ++.PP ++The settings below are in ++"group/key=\fIdefault_value\fR" format, and show ++the default values of the \fB00-primary\&.seat\fR file\&. For ++example, to specify a different "Seat Entry/Name" value, you would ++modify the this file so it contains these lines: ++.PP ++.nf ++[Seat Entry] ++[\&.\&.\&.] ++Name=Customized seat name ++.fi ++.PP ++The following keys are supported for configuring ConsoleKit seats: ++.sp ++.ne 2 ++.mk ++\fBSeat Entry/Version=1\&.0\fR ++.sp .6 ++.in +4 ++Version number of the seat file\&. This specifies the version number of the ++configuration file format used\&. Currently only the value "1\&.0" is ++supported\&. ++.sp ++.sp 1 ++.in -4 ++.sp ++.ne 2 ++.mk ++\fBSeat Entry/Name=Primary seat\fR ++.sp .6 ++.in +4 ++Name of the seat\&. ++.sp ++.sp 1 ++.in -4 ++.sp ++.ne 2 ++.mk ++\fBSeat Entry/ID=StaticSeat\fR ++.sp .6 ++.in +4 ++Specifies the unique ID of the seat\&. If the value is NULL, then ++\fBconsole-kit-daemon\fR will provide a value\&. The ID may only contain the ++ASCII characters [A-Z][a=z][0-9]_"\&. ++.sp ++.sp 1 ++.in -4 ++.sp ++.ne 2 ++.mk ++\fBSeat Entry/Hidden=false\fR ++.sp .6 ++.in +4 ++If this value is set to "false", then ConsoleKit will create this ++seat\&. Otherwise, the seat will not be created\&. ++.sp ++.sp 1 ++.in -4 ++.sp ++.ne 2 ++.mk ++\fBSeat Entry/Devices\fR ++.sp .6 ++.in +4 ++This value is not currently supported\&. In the future, it is planned that ++ConsoleKit will provide the ability to manage how device permissions are ++managed, and this key is a placeholder\&. ++.sp ++.sp 1 ++.in -4 ++.sp ++.ne 2 ++.mk ++\fBSeat Entry/Sessions=Local\fR ++.sp .6 ++.in +4 ++List of sessions to start on the seat, separated by the ";" ++character\&. Each session must be defined in a ConsoleKit session configuration ++file named ++\fB/etc/ConsoleKit/sessions\&.d/\fIsessions\fR\&.session\fR where \fIsessions\fR is the value of this key\&. ++.sp ++.sp 1 ++.in -4 ++.SS "ConsoleKit Session Configuration" ++.PP ++ConsoleKit session configuration files are located in the ++/etc/ConsoleKit/sessions\&.d directory\&. Each session ++configuration file ends with the \fB\&.session\fR suffix\&. ++Additional seat configuration files may be added\&. These files are in standard ++INI format\&. ++.PP ++The settings below are in ++"group/key" format, so to specify the "Session Entry/Name" ++value, the file shoulld contain these lines: ++.PP ++.nf ++[Session Entry] ++[\&.\&.\&.] ++Name=Customized Session ++.fi ++.PP ++The following keys are supported for configuring ConsoleKit sessions: ++.sp ++.ne 2 ++.mk ++\fBSession Entry/Name\fR ++.sp .6 ++.in +4 ++Unique name of the session\&. ++.sp ++.sp 1 ++.in -4 ++.sp ++.ne 2 ++.mk ++\fBSession Entry/Type\fR ++.sp .6 ++.in +4 ++Type of the session ++.sp ++.sp 1 ++.in -4 ++.sp ++.ne 2 ++.mk ++\fBSession Entry/Description\fR ++.sp .6 ++.in +4 ++Description of the session\&. ++.sp ++.sp 1 ++.in -4 ++.sp ++.ne 2 ++.mk ++\fBSession Entry/DisplayTemplate\fR ++.sp .6 ++.in +4 ++This specifies the display type to be used with the session\&. This corresponds ++to the file ++\fB/etc/ConsoleKit/displays\&.d/\fIdisplay_template\fR\&.display\fR ++where \fIdisplay_template\fR is the value of this key\&. ++.sp ++.sp 1 ++.in -4 ++.sp ++.ne 2 ++.mk ++\fBLocal/\fIvariable\fR\fR ++.sp .6 ++.in +4 ++The ConsoleKit display configuration file associated with the ++"Entry/DisplayTemplate" key specifies the command to run to launch ++the display\&. This command is defined in the ConsoleKit display configuration ++file in the key "X11/Exec"\&. This command can include variables that ++begin with the "$" character, such as "$display"\&. The ++values to be used for these variables can be defined in this section\&. So if ++the session configuration file contains the value ++"Local/display=:0", this will cause the variable used when launching ++the command to be replaced with the value "0"\&. ++.sp ++.sp 1 ++.in -4 ++.SS "ConsoleKit System Restart and Stop" ++.PP ++\fBconsole-kit-daemon\fR provides D-Bus interfaces that will restart or stop ++the system\&. When \fBconsole-kit-daemon\fR receives a D-Bus request to restart ++the system, it will run the ++\fB/usr/lib/ConsoleKit/scripts/ck-system-restart\fR script if ++the user has privilege to do this operation\&. When \fBconsole-kit-daemon\fR ++receives a D-Bus request to stop the system, it will run the ++\fB/usr/lib/ConsoleKit/scripts/ck-system-stop\fR script if the ++user has privilege to do this operation\&. ++.SH "EXAMPLES" ++.PP ++\fBExample 1: To start the ConsoleKit daemon\fR ++.PP ++.PP ++.nf ++example% \fBconsole-kit-daemon\fR ++.fi ++.PP ++\fBExample 2: To configure ConsoleKit to start multiple sessions on a single seat\fR ++.PP ++To start two local displays: DISPLAY ":0" on vt7 and DISPLAY ++":1" on "vt8", ++edit the \fB00-primary\&.seat\fR file as follows: ++.PP ++.nf ++[Seat Entry] ++Version=1\&.0 ++Name=Primary seat ++Description=start static displays :0 on vt7 and :1 on vt8 ++Hidden=false ++Devices= ++Sessions=Local;Local2; ++.fi ++.PP ++Then, in addition to the original ++\fB/etc/ConsoleKit/sessions\&.d/Local\&.session\fR file, add the ++following \fB/etc/ConsoleKit/sessions\&.d/Local2\&.session\fR file: ++.PP ++.nf ++[Session Entry] ++Name=Local ++Type=LoginWindow ++Description=Local Login Screen ++DisplayTemplate=Local ++ ++[Local] ++display=:1 ++vt=/dev/vt/8 ++.fi ++.PP ++.SH "SEE ALSO" ++.PP ++More information can be found at: ++.PP ++\fBhttps://github\&.com/ConsoleKit2/ConsoleKit2\fR ++.PP ++\fBck-history\fR(1), ++\fBck-launch-session\fR(1), ++\fBck-list-sessions\fR(1), ++\fBsvcadm\fR(1m), ++\fBenviron\fR(5), ++\fBsmf\fR(5), ++\fBconsole\fR(4) ++.SH "NOTES" ++.PP ++Brian Cameron, Sun Microsystems Inc\&., 2009\&. ++Copyright (c) 2009 by Sun Microsystems, Inc\&. ++.PP ++Some of the documentation in this manpage is from the ConsoleKit documentation ++written by William Jon McCann\&. ++...\" created by instant / solbook-to-man, Sat 24 Oct 2009, 14:10 ++...\" LSARC 2009/432 ConsoleKit +diff --git a/src/Makefile.am b/src/Makefile.am +index 80e1304..e4c5eb1 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -20,6 +20,7 @@ AM_CFLAGS = \ + -DDATADIR=\""$(datadir)"\" \ + -DSYSCONFDIR=\""$(sysconfdir)"\" \ + -DLOCALSTATEDIR=\""$(localstatedir)"\" \ ++ -DRUNDIR=\""$(RUNDIR)"\" \ + -DCONSOLE_KIT_PID_FILE=\""$(CONSOLE_KIT_PID_FILE)"\" \ + -DLOCALEDIR=\"$(localedir)\" \ + $(WARN_CFLAGS) \ +@@ -211,8 +212,8 @@ test_tty_idle_monitor_LDADD = \ + + test_inhibit_CFLAGS = \ + $(AM_CFLAGS) \ +- -ULOCALSTATEDIR \ +- -DLOCALSTATEDIR=\"/tmp\" \ ++ -URUNDIR \ ++ -DRUNDIR=\"/tmp\" \ + $(NULL) + + test_inhibit_SOURCES = \ +@@ -251,5 +252,5 @@ install-data-local: + -mkdir -p $(DESTDIR)$(prefix)/lib/ConsoleKit/run-session.d + -mkdir -p $(DESTDIR)$(sysconfdir)/ConsoleKit/run-seat.d + -mkdir -p $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d +- -mkdir -p $(DESTDIR)$(localstatedir)/run/ConsoleKit ++ -mkdir -p $(DESTDIR)$(RUNDIR)/ConsoleKit + -mkdir -p $(DESTDIR)$(localstatedir)/log/ConsoleKit +diff --git a/src/ck-inhibit.c b/src/ck-inhibit.c +index 6a87aa6..3395f95 100644 +--- a/src/ck-inhibit.c ++++ b/src/ck-inhibit.c +@@ -216,19 +216,19 @@ create_inhibit_base_directory (void) + gint res; + + errno = 0; +- res = g_mkdir_with_parents (LOCALSTATEDIR "/run/ConsoleKit/inhibit", ++ res = g_mkdir_with_parents (RUNDIR "/ConsoleKit/inhibit", + S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); + if (res < 0) { + g_warning ("Unable to create directory %s (%s)", +- LOCALSTATEDIR "/run/ConsoleKit/inhibit", ++ RUNDIR "/ConsoleKit/inhibit", + g_strerror (errno)); + + return FALSE; + } + +- if (g_chmod (LOCALSTATEDIR "/run/ConsoleKit/inhibit", 0755) == -1) { ++ if (g_chmod (RUNDIR "/ConsoleKit/inhibit", 0755) == -1) { + g_warning ("Failed to change permissions for %s", +- LOCALSTATEDIR "/run/ConsoleKit/inhibit"); ++ RUNDIR "/ConsoleKit/inhibit"); + } + + return TRUE; +@@ -391,8 +391,8 @@ get_named_pipe_path (const char* who) + + errno = 0; + +- path = g_strdup_printf ("%s/run/ConsoleKit/inhibit/inhibit.XXXXXX.pipe", +- LOCALSTATEDIR); ++ path = g_strdup_printf ("%s/ConsoleKit/inhibit/inhibit.XXXXXX.pipe", ++ RUNDIR); + + /* check that we got a string */ + if (path == NULL) { +diff --git a/src/ck-manager.c b/src/ck-manager.c +index e1bf022..da1cce6 100644 +--- a/src/ck-manager.c ++++ b/src/ck-manager.c +@@ -202,8 +202,8 @@ ck_manager_dump (CkManager *manager) + { + int fd; + int res; +- const char *filename = LOCALSTATEDIR "/run/ConsoleKit/database"; +- const char *filename_tmp = LOCALSTATEDIR "/run/ConsoleKit/database~"; ++ const char *filename = RUNDIR "/ConsoleKit/database"; ++ const char *filename_tmp = RUNDIR "/ConsoleKit/database~"; + + if (manager == NULL) { + g_warning ("ck_manager_dump: manager == NULL"); +@@ -212,16 +212,16 @@ ck_manager_dump (CkManager *manager) + + /* always make sure we have a directory */ + errno = 0; +- res = g_mkdir_with_parents (LOCALSTATEDIR "/run/ConsoleKit", ++ res = g_mkdir_with_parents (RUNDIR "/ConsoleKit", + S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); + if (res < 0) { + g_warning ("Unable to create directory %s (%s)", +- LOCALSTATEDIR "/run/ConsoleKit", ++ RUNDIR "/ConsoleKit", + g_strerror (errno)); + return; + } + +- g_debug ("ck_manager_dump: %s/run/ConsoleKit folder created", LOCALSTATEDIR); ++ g_debug ("ck_manager_dump: %s/ConsoleKit folder created", RUNDIR); + + fd = g_open (filename_tmp, O_CREAT | O_WRONLY, 0644); + if (fd == -1) { +diff --git a/src/main.c b/src/main.c +index 40d4e02..3137bf9 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -186,7 +186,7 @@ delete_inhibit_files (void) + { + GDir *dir; + GError *error = NULL; +- const gchar *INHIBIT_DIRECTORY = LOCALSTATEDIR "/run/ConsoleKit/inhibit"; ++ const gchar *INHIBIT_DIRECTORY = RUNDIR "/ConsoleKit/inhibit"; + const gchar *name; + + g_debug ("Cleaning up %s", INHIBIT_DIRECTORY); +diff --git a/tools/70-udev-acl.rules b/tools/70-udev-acl.rules +deleted file mode 100644 +index 2dac283..0000000 +--- a/tools/70-udev-acl.rules ++++ /dev/null +@@ -1,76 +0,0 @@ +-# do not edit this file, it will be overwritten on update +- +-# Do not use TAG+="udev-acl" outside of this file. This variable is private to +-# udev-acl of this udev release and may be replaced at any time. +- +-ENV{MAJOR}=="", GOTO="acl_end" +-ACTION=="remove", GOTO="acl_apply" +- +-# systemd replaces udev-acl entirely, skip if active +-TEST=="/sys/fs/cgroup/systemd", TAG=="uaccess", GOTO="acl_end" +- +-# PTP/MTP protocol devices, cameras, portable media players +-SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="*:060101:*", TAG+="udev-acl" +- +-# digicams with proprietary protocol +-ENV{ID_GPHOTO2}=="*?", TAG+="udev-acl" +- +-# SCSI and USB scanners +-ENV{libsane_matched}=="yes", TAG+="udev-acl" +- +-# HPLIP devices (necessary for ink level check and HP tool maintenance) +-ENV{ID_HPLIP}=="1", TAG+="udev-acl" +- +-# optical drives +-SUBSYSTEM=="block", ENV{ID_CDROM}=="1", TAG+="udev-acl" +-SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="4|5", TAG+="udev-acl" +- +-# sound devices +-SUBSYSTEM=="sound", TAG+="udev-acl" +- +-# ffado is an userspace driver for firewire sound cards +-SUBSYSTEM=="firewire", ENV{ID_FFADO}=="1", TAG+="udev-acl" +- +-# webcams, frame grabber, TV cards +-SUBSYSTEM=="video4linux", TAG+="udev-acl" +-SUBSYSTEM=="dvb", TAG+="udev-acl" +- +-# IIDC devices: industrial cameras and some webcams +-SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x00010*", TAG+="udev-acl" +-SUBSYSTEM=="firewire", ATTR{units}=="*0x00b09d:0x00010*", TAG+="udev-acl" +-# AV/C devices: camcorders, set-top boxes, TV sets, audio devices, and more +-SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x010001*", TAG+="udev-acl" +-SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x014001*", TAG+="udev-acl" +- +-# DRI video devices +-SUBSYSTEM=="drm", KERNEL=="card*", TAG+="udev-acl" +- +-# KVM +-SUBSYSTEM=="misc", KERNEL=="kvm", TAG+="udev-acl" +- +-# smart-card readers +-ENV{ID_SMARTCARD_READER}=="*?", TAG+="udev-acl" +- +-# PDA devices +-ENV{ID_PDA}=="*?", TAG+="udev-acl" +- +-# Programmable remote control +-ENV{ID_REMOTE_CONTROL}=="1", TAG+="udev-acl" +- +-# joysticks +-SUBSYSTEM=="input", ENV{ID_INPUT_JOYSTICK}=="?*", TAG+="udev-acl" +- +-# color measurement devices +-ENV{COLOR_MEASUREMENT_DEVICE}=="*?", TAG+="udev-acl" +- +-# DDC/CI device, usually high-end monitors such as the DreamColor +-ENV{DDC_DEVICE}=="*?", TAG+="udev-acl" +- +-# media player raw devices (for user-mode drivers, Android SDK, etc.) +-SUBSYSTEM=="usb", ENV{ID_MEDIA_PLAYER}=="?*", TAG+="udev-acl" +- +-# apply ACL for all locally logged in users +-LABEL="acl_apply", TAG=="udev-acl", TEST=="/var/run/ConsoleKit/database", \ +- RUN+="udev-acl --action=$env{ACTION} --device=$env{DEVNAME}" +- +-LABEL="acl_end" +diff --git a/tools/70-udev-acl.rules.in b/tools/70-udev-acl.rules.in +new file mode 100644 +index 0000000..de6720e +--- /dev/null ++++ b/tools/70-udev-acl.rules.in +@@ -0,0 +1,76 @@ ++# do not edit this file, it will be overwritten on update ++ ++# Do not use TAG+="udev-acl" outside of this file. This variable is private to ++# udev-acl of this udev release and may be replaced at any time. ++ ++ENV{MAJOR}=="", GOTO="acl_end" ++ACTION=="remove", GOTO="acl_apply" ++ ++# systemd replaces udev-acl entirely, skip if active ++TEST=="/sys/fs/cgroup/systemd", TAG=="uaccess", GOTO="acl_end" ++ ++# PTP/MTP protocol devices, cameras, portable media players ++SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="*:060101:*", TAG+="udev-acl" ++ ++# digicams with proprietary protocol ++ENV{ID_GPHOTO2}=="*?", TAG+="udev-acl" ++ ++# SCSI and USB scanners ++ENV{libsane_matched}=="yes", TAG+="udev-acl" ++ ++# HPLIP devices (necessary for ink level check and HP tool maintenance) ++ENV{ID_HPLIP}=="1", TAG+="udev-acl" ++ ++# optical drives ++SUBSYSTEM=="block", ENV{ID_CDROM}=="1", TAG+="udev-acl" ++SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="4|5", TAG+="udev-acl" ++ ++# sound devices ++SUBSYSTEM=="sound", TAG+="udev-acl" ++ ++# ffado is an userspace driver for firewire sound cards ++SUBSYSTEM=="firewire", ENV{ID_FFADO}=="1", TAG+="udev-acl" ++ ++# webcams, frame grabber, TV cards ++SUBSYSTEM=="video4linux", TAG+="udev-acl" ++SUBSYSTEM=="dvb", TAG+="udev-acl" ++ ++# IIDC devices: industrial cameras and some webcams ++SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x00010*", TAG+="udev-acl" ++SUBSYSTEM=="firewire", ATTR{units}=="*0x00b09d:0x00010*", TAG+="udev-acl" ++# AV/C devices: camcorders, set-top boxes, TV sets, audio devices, and more ++SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x010001*", TAG+="udev-acl" ++SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x014001*", TAG+="udev-acl" ++ ++# DRI video devices ++SUBSYSTEM=="drm", KERNEL=="card*", TAG+="udev-acl" ++ ++# KVM ++SUBSYSTEM=="misc", KERNEL=="kvm", TAG+="udev-acl" ++ ++# smart-card readers ++ENV{ID_SMARTCARD_READER}=="*?", TAG+="udev-acl" ++ ++# PDA devices ++ENV{ID_PDA}=="*?", TAG+="udev-acl" ++ ++# Programmable remote control ++ENV{ID_REMOTE_CONTROL}=="1", TAG+="udev-acl" ++ ++# joysticks ++SUBSYSTEM=="input", ENV{ID_INPUT_JOYSTICK}=="?*", TAG+="udev-acl" ++ ++# color measurement devices ++ENV{COLOR_MEASUREMENT_DEVICE}=="*?", TAG+="udev-acl" ++ ++# DDC/CI device, usually high-end monitors such as the DreamColor ++ENV{DDC_DEVICE}=="*?", TAG+="udev-acl" ++ ++# media player raw devices (for user-mode drivers, Android SDK, etc.) ++SUBSYSTEM=="usb", ENV{ID_MEDIA_PLAYER}=="?*", TAG+="udev-acl" ++ ++# apply ACL for all locally logged in users ++LABEL="acl_apply", TAG=="udev-acl", TEST=="@RUNDIR@/ConsoleKit/database", \ ++ RUN+="udev-acl --action=$env{ACTION} --device=$env{DEVNAME}" ++ ++LABEL="acl_end" +diff --git a/tools/Makefile.am b/tools/Makefile.am +index 774b4ed..5138e03 100644 +--- a/tools/Makefile.am ++++ b/tools/Makefile.am +@@ -45,6 +45,7 @@ AM_CFLAGS = \ + -DDATADIR=\""$(datadir)"\" \ + -DSYSCONFDIR=\""$(sysconfdir)"\" \ + -DLOCALSTATEDIR=\""$(localstatedir)"\" \ ++ -DRUNDIR=\""$(RUNDIR)"\" \ + -DLOCALEDIR=\"$(localedir)\" \ + $(HISTORY_CFLAGS) \ + $(WARN_CFLAGS) \ +diff --git a/tools/udev-acl.c b/tools/udev-acl.c +index 4f49f04..5e394fb 100644 +--- a/tools/udev-acl.c ++++ b/tools/udev-acl.c +@@ -132,7 +132,7 @@ static GSList *uids_with_local_active_session(const char *own_id) + GKeyFile *keyfile; + + keyfile = g_key_file_new(); +- if (g_key_file_load_from_file(keyfile, "/var/run/ConsoleKit/database", 0, NULL)) { ++ if (g_key_file_load_from_file(keyfile, RUNDIR "/ConsoleKit/database", 0, NULL)) { + gchar **groups; + + groups = g_key_file_get_groups(keyfile, NULL); +-- +2.2.1 + diff --git a/srcpkgs/ConsoleKit2/patches/0011-Fix-for-GLib-CRITICAL-Source-ID-was-not-found.patch b/srcpkgs/ConsoleKit2/patches/0011-Fix-for-GLib-CRITICAL-Source-ID-was-not-found.patch new file mode 100644 index 0000000000..4221c11ff0 --- /dev/null +++ b/srcpkgs/ConsoleKit2/patches/0011-Fix-for-GLib-CRITICAL-Source-ID-was-not-found.patch @@ -0,0 +1,64 @@ +From 80543593f10b28531c7d7207c82f64dd8ea78590 Mon Sep 17 00:00:00 2001 +From: Eric Koegel +Date: Wed, 10 Dec 2014 19:36:56 +0300 +Subject: [PATCH 11/12] Fix for GLib-CRITICAL: Source ID was not found + +On remote ck session, there was a warning generated during log out. +This patch should fix that warning as well as add a couple debug +lines to help future troubleshooting. Thanks to hhoffstaette for +helping to troubleshoot this issue. For details see: +https://github.com/ConsoleKit2/ConsoleKit2/pull/15 +--- + src/ck-tty-idle-monitor.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/src/ck-tty-idle-monitor.c b/src/ck-tty-idle-monitor.c +index 2aba92a..2b41917 100644 +--- a/src/ck-tty-idle-monitor.c ++++ b/src/ck-tty-idle-monitor.c +@@ -169,6 +169,7 @@ ck_tty_idle_monitor_get_property (GObject *object, + static void + remove_idle_hint_timeout (CkTtyIdleMonitor *tty_idle_monitor) + { ++ g_debug ("remove_idle_hint_timeout: checking timeout_id %d", tty_idle_monitor->priv->timeout_id); + if (tty_idle_monitor->priv->timeout_id > 0) { + g_source_remove (tty_idle_monitor->priv->timeout_id); + tty_idle_monitor->priv->timeout_id = 0; +@@ -225,6 +226,9 @@ check_tty_idle (CkTtyIdleMonitor *monitor) + time_t idletime; + time_t last_access; + ++ g_debug ("check_tty_idle: setting timeout_id %d to 0", monitor->priv->timeout_id); ++ monitor->priv->timeout_id = 0; ++ + if (monitor->priv->device == NULL) { + return FALSE; + } +@@ -246,8 +250,6 @@ check_tty_idle (CkTtyIdleMonitor *monitor) + + tty_idle_monitor_set_idle_hint_internal (monitor, is_idle); + +- monitor->priv->timeout_id = 0; +- + if (is_idle) { + if (! monitor_add_watch (monitor)) { + /* if we can't add a watch just add a new timer */ +@@ -275,6 +277,7 @@ static void + schedule_tty_check (CkTtyIdleMonitor *monitor, + guint seconds) + { ++ g_debug ("schedule_tty_check: timeout_id %d", monitor->priv->timeout_id); + if (monitor->priv->timeout_id == 0) { + #if GLIB_CHECK_VERSION(2,14,0) + monitor->priv->timeout_id = g_timeout_add_seconds (seconds, +@@ -285,6 +288,7 @@ schedule_tty_check (CkTtyIdleMonitor *monitor, + (GSourceFunc)check_tty_idle, + monitor); + #endif ++ g_debug ("schedule_tty_check: timeout_id %d", monitor->priv->timeout_id); + } + } + +-- +2.2.1 + diff --git a/srcpkgs/ConsoleKit2/patches/0012-Fixup-a-couple-of-missed-hardcoded-var-run-usages.patch b/srcpkgs/ConsoleKit2/patches/0012-Fixup-a-couple-of-missed-hardcoded-var-run-usages.patch new file mode 100644 index 0000000000..bc5517c783 --- /dev/null +++ b/srcpkgs/ConsoleKit2/patches/0012-Fixup-a-couple-of-missed-hardcoded-var-run-usages.patch @@ -0,0 +1,88 @@ +From e4bc312cc5a5363ccf887475d187e5fbc07e0ad2 Mon Sep 17 00:00:00 2001 +From: Robby Workman +Date: Thu, 11 Dec 2014 02:09:40 -0600 +Subject: [PATCH 12/12] Fixup a couple of missed hardcoded /var/run/ usages + +--- + configure.ac | 1 + + src/main.c | 2 +- + tools/pam-foreground-compat.ck | 17 ----------------- + tools/pam-foreground-compat.ck.in | 17 +++++++++++++++++ + 4 files changed, 19 insertions(+), 18 deletions(-) + delete mode 100755 tools/pam-foreground-compat.ck + create mode 100755 tools/pam-foreground-compat.ck.in + +diff --git a/configure.ac b/configure.ac +index dd1f5bb..ff18e97 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -489,6 +489,7 @@ Makefile + src/Makefile + tools/70-udev-acl.rules + tools/Makefile ++tools/pam-foreground-compat.ck + tools/linux/Makefile + tools/freebsd/Makefile + tools/openbsd/Makefile +diff --git a/src/main.c b/src/main.c +index 3137bf9..99150ee 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -150,7 +150,7 @@ delete_pid (void) + unlink (CONSOLE_KIT_PID_FILE); + } + +-#define CONSOLE_TAGS_DIR "/var/run/console" ++#define CONSOLE_TAGS_DIR RUNDIR "/console" + + static void + delete_console_tags (void) +diff --git a/tools/pam-foreground-compat.ck b/tools/pam-foreground-compat.ck +deleted file mode 100755 +index ce221c9..0000000 +--- a/tools/pam-foreground-compat.ck ++++ /dev/null +@@ -1,17 +0,0 @@ +-#!/bin/sh +-TAGDIR=/var/run/console +- +-[ -n "$CK_SESSION_USER_UID" ] || exit 1 +-[ "$CK_SESSION_IS_LOCAL" = "true" ] || exit 0 +- +-TAGFILE="$TAGDIR/`getent passwd $CK_SESSION_USER_UID | cut -f 1 -d:`" +- +-if [ "$1" = "session_added" ]; then +- mkdir -p "$TAGDIR" +- echo "$CK_SESSION_ID" >> "$TAGFILE" +-fi +- +-if [ "$1" = "session_removed" ] && [ -e "$TAGFILE" ]; then +- sed -i "\%^$CK_SESSION_ID\$%d" "$TAGFILE" +- [ -s "$TAGFILE" ] || rm -f "$TAGFILE" +-fi +diff --git a/tools/pam-foreground-compat.ck.in b/tools/pam-foreground-compat.ck.in +new file mode 100755 +index 0000000..67ca844 +--- /dev/null ++++ b/tools/pam-foreground-compat.ck.in +@@ -0,0 +1,17 @@ ++#!/bin/sh ++TAGDIR=@RUNDIR@/console ++ ++[ -n "$CK_SESSION_USER_UID" ] || exit 1 ++[ "$CK_SESSION_IS_LOCAL" = "true" ] || exit 0 ++ ++TAGFILE="$TAGDIR/`getent passwd $CK_SESSION_USER_UID | cut -f 1 -d:`" ++ ++if [ "$1" = "session_added" ]; then ++ mkdir -p "$TAGDIR" ++ echo "$CK_SESSION_ID" >> "$TAGFILE" ++fi ++ ++if [ "$1" = "session_removed" ] && [ -e "$TAGFILE" ]; then ++ sed -i "\%^$CK_SESSION_ID\$%d" "$TAGFILE" ++ [ -s "$TAGFILE" ] || rm -f "$TAGFILE" ++fi +-- +2.2.1 + diff --git a/srcpkgs/ConsoleKit2/template b/srcpkgs/ConsoleKit2/template index d622eecf8a..d9b589a994 100644 --- a/srcpkgs/ConsoleKit2/template +++ b/srcpkgs/ConsoleKit2/template @@ -1,10 +1,12 @@ # Template file for 'ConsoleKit2' pkgname=ConsoleKit2 version=0.9.2 -revision=1 +revision=2 +patch_args="-Np1" build_style=gnu-configure configure_args="ac_cv_file__sys_class_tty_tty0_active=yes - --enable-udev-acl --with-pam-module-dir=/usr/lib/security --enable-pam-module" + --with-rundir=/run --enable-udev-acl --enable-pam-module + --with-pam-module-dir=/usr/lib/security" hostmakedepends="automake libtool pkg-config gettext-devel glib-devel" makedepends="acl-devel libudev-devel polkit-devel dbus-glib-devel glib-devel libX11-devel pam-devel" depends="dbus" @@ -27,9 +29,6 @@ make_dirs=" pre_configure() { autoreconf -fi } -post_install() { - vinstall data/90-consolekit 755 etc/X11/xinit/xinitrc.d -} ConsoleKit2-devel_package() { short_desc+=" - development files"